07.06.2013, 07:54
Greeting.
I got the fs change the car color after another, and I want to do when you / vchange to go all the time even if you get out of the car when you get out of the car no longer change colors and have to give and / vchange, I hope you understand.
Command:
All Fs:
I got the fs change the car color after another, and I want to do when you / vchange to go all the time even if you get out of the car when you get out of the car no longer change colors and have to give and / vchange, I hope you understand.
Command:
Quote:
CMD:vchange ( playerid , params [ ] ) { if ( CVeh_Color [ playerid ] == 0) { CVeh_Color [ playerid ] = 1 ; Timer = SetTimerEx ( "ccolor" , 100 , true , "i" , GetPlayerVehicleID ( playerid ) ) ; } else { CVeh_Color [ playerid ] = 0 ; KillTimer ( Timer ) ; } return 1 ; } |
Quote:
public OnPlayerStateChange(playerid, newstate, oldstate) { if ( newstate == PLAYER_STATE_ONFOOT ) { CVeh_Color [ playerid ] = 0 ; KillTimer ( Timer ) ; } return 1; } forward ccolor ( vehicleid ) ; public ccolor ( vehicleid ) { ChangeVehicleColor( vehicleid , random ( 256 ) , random ( 256 ) ) ; return 1; } CMD:vchange ( playerid , params [ ] ) { if ( CVeh_Color [ playerid ] == 0) { CVeh_Color [ playerid ] = 1 ; Timer = SetTimerEx ( "ccolor" , 100 , true , "i" , GetPlayerVehicleID ( playerid ) ) ; } else { CVeh_Color [ playerid ] = 0 ; KillTimer ( Timer ) ; } return 1 ; } |