Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new
- playerRainbowCar[MAX_PLAYERS],
- playerRainBowTimer[MAX_PLAYERS]
- ;
- public OnPlayerConnect(playerid) {
- playerRainbowCar[playerid] = -1;
- }
- forward rainbowCar(playerid); // timer
- public rainbowCar(playerid) {
- ChangeVehicleColor(playerRainbowCar[MAX_PLAYERS], random(100), random(100));
- }
- public OnPlayerStateChange(playerid, newstate, oldstate) {
- if(newstate == PLAYER_STATE_DRIVER) {
- if(playerRainbowCar[playerid] == GetPlayerVehicleID(playerid)) {
- playerRainBowTimer[playerid] = SetTimerEx("rainbowCar", 1000, 1, "i", playerid);
- }
- }
- if(oldstate == PLAYER_STATE_DRIVER) {
- if(playerRainbowCar[playerid] == GetPlayerVehicleID(playerid)) {
- KillTimer(playerRainBowTimer[playerid]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement