AmaMa.
AmaMa.#3768
Wiek: 25 Na forum: 3207 dni Posty: 182
Nick w MP: AmaMa.
Piwa : 1825
Witam, mam problem z shaderem. Ot?? w??cza si? jak naci?nie si? w gui, ale nie chce si? wy??czy?. Za pomoc i
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 )