addEventHandler("onClientResourceStart",resourceRoot,function()
Shader = dxCreateShader("color.fx") --shader
end)
function DajKolorTarczy(r,g,b)
if Shader then
if r and g and b then
engineApplyShaderToWorldTexture(Shader,"124_bremze") --nazwa tesktury ktorej mamy nadac kolor
dxSetShaderValue(Shader, "gColor", r/255, g/255, b/255)
end
end
end
function ResetujKolorTarcz()
if Shader then
engineRemoveShaderFromWorldTexture(Shader,"124_bremze") --nazwa tesktury ktorej mamy usunac kolor
end
end
addCommandHandler("pomaluj",function(command,r,g,b)
if r and g and b then
local r,g,b = tonumber(r),tonumber(g),tonumber(b)
if r <= 255 and g <= 255 and b <= 255 then
DajKolorTarczy(r,g,b)
outputChatBox("#00C000Pomalowano tarcze na kolor : "..r..", "..g..", "..b.." .",255,0,0,true)
else
outputChatBox("Wystapi? b?ad z kodem na kolor wpisz go ponownie poprawnie!",255,0,0,true)
end
else
ResetujKolorTarcz()
outputChatBox("#00C000Zresetowano kolor tarcz.",255,0,0,true)
end
end)