Jump to content

Help nitro color


freudo

Recommended Posts

Hey

Not saving nitro color.

and I select a color not changing color

Client:

--------------------------------------------------------------------------------- 
-- 
-- Nitro shader 
-- 
-- 
--------------------------------------------------------------------------------- 
  
addEventHandler("onClientResourceStart",resourceRoot, 
function() 
    nitroShader = dxCreateShader("nitro.fx") 
    setTimer(updateNitroColor,1000,1,255,0,0) 
end) 
  
-- This function will set the new color of the nitro 
function updateNitroColor(r,g,b) 
    if nitroShader then 
        if r and g and b then 
            engineApplyShaderToWorldTexture (nitroShader,"smoke") 
            dxSetShaderValue (nitroShader, "gNitroColor", r/255, g/0, b/0 ) 
        end 
    end 
end 
  
-- This function will reset the nitro back to the original 
function resetNitroColor() 
    if nitroShader then 
        engineRemoveShaderFromWorldTexture(nitroShader,"smoke") 
    end 
end 
  
function nitro () 
openPicker ( "nitrorenk", "#FFFFFF", "Nitro rengi" ) 
end 
addCommandHandler("nitro", nitro) 
  
addEvent ( "onColorPickerOK", true ) 
addEventHandler ( "onColorPickerOK", root, 
function ( id, hex, r, g, b ) 
    if ( id == "nitrorenk" ) then 
            updateNitroColor(r,g,b) 
    end 
end 
) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...