shourya90

count

Mar 27th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.85 KB | None | 0 0
  1. Timer:raceCountdownTimer,
  2. raceCountdownTime = 0,
  3.  
  4. ACMD:startrace[4](playerid, params[])
  5. {
  6.     if(!RaceOpen)
  7.     {  
  8.         stop raceCountdownTimer;
  9.         raceCountdownTime = 5;
  10.         raceCountdownTimer = repeat raceCountdown[1000]();
  11.     }      
  12.     else
  13.     {
  14.         Message(playerid, -1, "{58D3F7}[EVENT HELP] {FFFFFF}first type /raceevent again to close entry, then type /startrace ");
  15.     }  
  16.     return 1;
  17. }
  18.  
  19. timer raceCountdown[1000]()
  20. {
  21.     foreach(new i : Racers)
  22.     {
  23.         if(pData[i][InsideRace])
  24.         {
  25.             if(!raceCountdownTime)
  26.             {
  27.                 stop raceCountdownTimer;
  28.                 TogglePlayerControllable(i, true);
  29.                 GameTextForPlayer(i, "Event Started!!!", 1000, 5);
  30.                 ToggleEngine(pData[i][RaceCar], true);
  31.             }
  32.             else
  33.             {
  34.                 new msg[12];
  35.                 format(msg, 12, "~r~%d", raceCountdownTime);
  36.                 GameTextForPlayer(i, msg, 1000, 3);
  37.                 raceCountdownTime--;
  38.             }
  39.         }
  40.     }      
  41.     return 1;
  42. }
Add Comment
Please, Sign In to add comment