Advertisement
Sufyan

Countdown [Time Left]

Apr 14th, 2012
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.03 KB | None | 0 0
  1. //Top Of Your Script
  2. new GameTimer;
  3. new GameMinutes = 4;
  4. new GameSeconds = 59;
  5. new Text:Textdraw3;
  6.  
  7. //Under OnGameModeInit Or OnFilterScriptInit
  8. GameTimer = SetTimer("GameTime",1000,1);
  9.  
  10.  
  11.     Textdraw3 = TextDrawCreate(280.000000, 417.000000, "~b~Time Left ~n~~r~   00:00");
  12.     TextDrawBackgroundColor(Textdraw3, 255);
  13.     TextDrawFont(Textdraw3, 2);
  14.     TextDrawLetterSize(Textdraw3, 0.410000, 1.400000);
  15.     TextDrawColor(Textdraw3, -1);
  16.     TextDrawSetOutline(Textdraw3, 1);
  17.     TextDrawSetProportional(Textdraw3, 1);
  18.  
  19.  
  20. //Under OnGameModeExit Or OnFilterScriptExit
  21. KillTimer(GameTimer);
  22.  
  23.  
  24. //Any Where in u r script
  25.  
  26. forward GameTime();
  27. public GameTime()
  28. {
  29.     if(GameSeconds || GameMinutes)
  30.     {
  31.         GameSeconds--;
  32.         if(GameSeconds <= -1)
  33.         {
  34.             GameMinutes--;
  35.             GameSeconds=59;
  36.         }
  37.         new TimeString[256];
  38.         format(TimeString,sizeof(TimeString),"~b~Time Left ~n~~r~   %02d:%02d",GameMinutes,GameSeconds);
  39.         TextDrawSetString(Textdraw3,TimeString);
  40.     }
  41.  
  42.     return 1;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement