Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2018-01-13, 11:23


AmaMa.

AmaMa.#3768






Wiek: 26
Na forum: 3349 dni
Posty: 182
Nick w MP: AmaMa.

Piwa: 1835

Respekt: 165,3
Respekt: 165,3Respekt: 165,3

Witam, mam problem z shaderem. Ot?? w??cza si? jak naci?nie si? w gui, ale nie chce si? wy??czy?. Za pomoc R* i :piwo:

shader.lua

local texturesimg = {
{"img/2.png", "particleskid"},
{"img/3.png", "cloudmasked"},
{"img/3.png", "cardebris_01"},
{"img/3.png", "cardebris_02"},
{"img/3.png", "cardebris_03"},
{"img/3.png", "cardebris_04"},
{"img/3.png", "cardebris_05"},
{"img/4.png", "headlight1"},
{"img/5.png", "headlight"},
{"img/off.png", "vehiclelights128"},
{"img/on.png", "vehiclelightson128"},
{"img/3.png", "cloudhigh"}}

function enableslady()
    if soEffectEnabled then return end
    for i = 1, #texturesimg do
    shader = dxCreateShader("chaticon.fx")
    soEffectEnabled = true
    if soEffectEnabled then
    engineApplyShaderToWorldTexture(shader, texturesimg[i][2])
    dxSetShaderValue(shader, "gTexture", dxCreateTexture(texturesimg[i][1]))
    end
end
end
    
function disableslady()
    if not soEffectEnabled then return end
    engineRemoveShaderFromWorldTexture(shader,"*")
    texturesimg = {}    
    destroyElement(shader)
    shader = nil
    soEffectEnabled = false
end


switch

addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource()),
    function()

        triggerEvent( "switchslady", resourceRoot, false )
    end
)


--------------------------------
-- Switch effect on or off
--------------------------------
function switchsladyopon( soOn )
    if soOn then
        enableslady()
    else
        disableslady()
    end
end

addEvent( "switchslady", true )
addEventHandler( "switchslady", resourceRoot, switchsladyopon )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-01-13, 13:38


koxpl2x22

MAPPER-ALLEREK






Wiek: 23
Na forum: 4697 dni
Posty: 375
Nick w MP: ALLEREK

Piwa: 1725

Respekt: 142,5
Respekt: 142,5

Nada?e? mu upr. administratora?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-01-14, 09:13


AmaMa.

AmaMa.#3768






Wiek: 26
Na forum: 3349 dni
Posty: 182
Nick w MP: AmaMa.

Piwa: 1835

Respekt: 165,3
Respekt: 165,3Respekt: 165,3

Nie rozsmieszaj mnie xd

Podpis
Postaw piwo autorowi tego posta
 

 
Tagi: shader
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku