Jump to content

Nitro colour


SuleymanM

Recommended Posts

this is in client.lua:

How to modify ... to get team color?

---------------------------------------------------------------------------------

--

-- Nitro shader

--

--

---------------------------------------------------------------------------------

addEventHandler("onClientResourceStart",resourceRoot,

function()

nitroShader = dxCreateShader("nitro.fx")

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/255, b/255 )

end

end

end

-- This function will reset the nitro back to the original

function resetNitroColor()

if nitroShader then

engineRemoveShaderFromWorldTexture(nitroShader,"smoke")

end

end

-- Example command use

addCommandHandler("nitro",

function(command,r,g,b)

if r and g and b then

local r,g,b = tonumber®,tonumber(g),tonumber(b)

if r <= 255 and g <= 255 and b <= 255 then

updateNitroColor(r,g,b)

outputChatBox("Nitro color updated!",255,255,255,true)

else

outputChatBox("Colors must be between 0 and 255",255,255,255,true)

end

else

resetNitroColor()

outputChatBox("Nitro color reset to original!",255,255,255,true)

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...