Albinix Posted May 3, 2010 Share Posted May 3, 2010 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
Dark Dragon Posted May 3, 2010 Share Posted May 3, 2010 save the timer to a variable, then use killTImer local myTimer = setTimer(blah,10000,0) -- (later) killTimer(myTimer) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now