Advertisement
Sufyan

Lap Timer

Jul 15th, 2012
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.69 KB | None | 0 0
  1. //Top Of Your Script
  2. new Minutes[ MAX_PLAYERS ] ;
  3. new Seconds [ MAX_PLAYERS ] ;
  4. new Timer [ MAX_PLAYERS ] ;
  5.  
  6. //Jahan se Tujhe Counting start karni hai wahan pe Timer lagao
  7.  
  8. Timer [ playerid ] = SetTimerEx ( "CountTime" , 1000 , true , "i" , playerid) ;
  9.  
  10.  
  11.  
  12. //Function
  13.  
  14. public CountTime ( playerid )
  15. {
  16.     Seconds [ playerid ] ++ ;
  17.  
  18.     if(Seconds [ playerid ] >= 60)
  19.     {
  20.  
  21.     Minutes [ playerid ]++;
  22.     Seconds[playerid] = 0 ;
  23.     }
  24.  
  25. }
  26.  
  27. //KillTimer When you done or u want to reset...
  28.  
  29. KillTimer ( Timer [ playerid ] ) ;
  30.  
  31.  
  32. //Output
  33.  
  34. new str [ 128 ] ;
  35. format(str,sizeof(str),"Lap Time --> Minutes: %d || Seconds: %d",Minutes[playerid],Seconds[playerid]);
  36. SendClientMessage(playerid,-1,str);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement