Jump to content

Carcolor


Recommended Posts

hello i want to make a script when you connect to the server your car is black.

and if you type /red the car will be red (i'm gonna add more colors later)

so i wonder how to kill the timer so when you type /red the car will be red?

function VehColor()
  for i, car in ipairs( getElementsByType( "vehicle" ) ) do
     setVehicleColor ( car, 0, 0, 0, 0 )
  end
end
 
setTimer( VehColor, 500, 0 )
 
function VehColorred( player, command )
  for i, car in ipairs( getElementsByType( "vehicle" ) ) do
     setVehicleColor ( car, 3, 3, 3, 3 )
  end
end
 
setTimer( VehColorred, 500, 0 )
 
addCommandHandler("Red",VehColorred)
 
addEventHandler ( "onResourceStart", getRootElement(), VehColor )

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