local myShaderlocal timerfunction update( )if tonumber( exports[\'account-system\']:loadSavedData(\"enable_vehicle_shader\", \"1\") ) == 1 thenif myShader then returnend-- Create shadermyShader, tec = dxCreateShader ( \"car_paint.fx\" )if not myShader then -- outputChatBox( \"Could not create shader. Please use debugscript 3\" )else --outputDebugString( \"water shader: Using technique \" .. tec ) local textureVol = dxCreateTexture ( \"images/smallnoise3d.dds\" ); local textureCube = dxCreateTexture ( \"images/cube_env256.dds\" ); dxSetShaderValue ( myShader, \"sRandomTexture\", textureVol ); dxSetShaderValue ( myShader, \"sReflectionTexture\", textureCube ); -- Apply to world texture engineApplyShaderToWorldTexture ( myShader, \"vehiclegrunge256\" ) engineApplyShaderToWorldTexture ( myShader, \"?emap*\" ) --[[ timer = setTimer( function() if myShader then local r,g,b,a = getWaterColor() dxSetShaderValue ( myShader, \"gVehicleColor\", r/255, g/255, b/255, a/255 ); end end, 5000, 0 )endelseif myShader then destroyElement(myShader) killTimer(timer) myShader = nil]]endendendaddEventHandler( \"onClientResourceStart\", resourceRoot, update )addEventHandler( \"accounts:options:settings:updated\", root, update )
local isPlayerUseShaderlocal myShaderlocal timerfunction update( ) if tonumber( exports[\'account-system\']:loadSavedData(\"enable_vehicle_shader\", \"1\") ) == 1 then if myShader then return end -- Create shader myShader, tec = dxCreateShader ( \"car_paint.fx\" ) if not myShader then -- outputChatBox( \"Could not create shader. Please use debugscript 3\" ) else --outputDebugString( \"water shader: Using technique \" .. tec ) if isPlayerUseShader then isPlayerUseShader = false engineRemoveShaderToWorldTexture ( myShader, \"vehiclegrunge256\" ) engineRemoveShaderToWorldTexture ( myShader, \"?emap*\" ) myShader = nil else isPlayerUseShader = true local textureVol = dxCreateTexture ( \"images/smallnoise3d.dds\" ); local textureCube = dxCreateTexture ( \"images/cube_env256.dds\" ); dxSetShaderValue ( myShader, \"sRandomTexture\", textureVol ); dxSetShaderValue ( myShader, \"sReflectionTexture\", textureCube ); -- Apply to world texture engineApplyShaderToWorldTexture ( myShader, \"vehiclegrunge256\" ) engineApplyShaderToWorldTexture ( myShader, \"?emap*\" ) end --[[ timer = setTimer( function() if myShader then local r,g,b,a = getWaterColor() dxSetShaderValue ( myShader, \"gVehicleColor\", r/255, g/255, b/255, a/255 ); end end, 5000, 0 ) end else if myShader then destroyElement(myShader) killTimer(timer) myShader = nil]] end endendaddCommandHandler(\"shader\", update)addEventHandler( \"onClientResourceStart\", resourceRoot, update )addEventHandler( \"accounts:options:settings:updated\", root, update )