Guest User

ChangeCarColor

a guest
May 19th, 2014
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.02 KB | None | 0 0
  1. /*
  2. Fait par Christopher # Kiki_Readon # Kiki53
  3. CCC [ChangeCarColor]
  4. */
  5.  
  6. #include <a_samp>
  7.  
  8. forward RainBowColor(playerid);
  9.  
  10. new RainBowColor1;
  11. new RainBow[MAX_PLAYERS];
  12.  
  13. public OnPlayerCommandText(playerid, cmdtext[])
  14. {
  15.     if(strcmp(cmdtext, "/RainBow", true) == 0)
  16.     {
  17.         if( !IsPlayerInAnyVehicle( playerid ) ) return SendClientMessage( playerid, -1, "Tu doit être dans un véhicule!" );
  18.         if(RainBow[playerid] == 0)
  19.         {
  20.                 SendClientMessage(playerid, -1, "RainBow activé");
  21.                 RainBowColor(playerid);
  22.                 RainBow[playerid] = 1;
  23.         }
  24.         else
  25.         {
  26.                 SendClientMessage(playerid, -1, "Rainbow désactivé");
  27.                 KillTimer(RainBowColor1);
  28.                 RainBow[playerid] = 0;
  29.         }
  30.         return 1;
  31.     }
  32.     return 0;
  33. }
  34. public RainBowColor(playerid)
  35. {
  36.     new Couleur = random(255) + 1;
  37.     new vehicleid = GetPlayerVehicleID(playerid);
  38.  
  39.     ChangeVehicleColor(vehicleid, Couleur, Couleur);
  40.     RainBowColor1 = SetTimerEx("RainBowColor", 500, 0, "d" ,playerid);
  41. }
Advertisement
Add Comment
Please, Sign In to add comment