Guest User

Untitled

a guest
Dec 13th, 2011
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.81 KB | None | 0 0
  1. /*================
  2. =    countdown   =
  3. =================*/
  4.  
  5. #include <a_samp>
  6. #include <YSI\y_commands>
  7. #include <sscanf2>
  8.  
  9. #define lup(%0) for(new %0 = 0; %0 < MAX_PLAYERS; %0++)
  10.  
  11. new countdown = -1,
  12.     timer;
  13.  
  14. YCMD:ct(playerid,params[],help)
  15. {
  16.     #pragma unused help
  17.     new koliko;
  18.     if(sscanf(params, "i",koliko)) return SendClientMessage(playerid,-1,"KORISTI: /ct [sekundi]");
  19.     countdown = koliko;
  20.     new
  21.          str[32];
  22.     format(str,32,"~g~%d",koliko);
  23.     GameTextForAll(str,1000,6);
  24.     timer = SetTimer("ct",1000,1);
  25.     return true;
  26. }
  27.  
  28. forward ct();
  29. public ct()
  30. {
  31.     countdown--;
  32.     new
  33.          str[32];
  34.     format(str,32,"~g~%d",countdown);
  35.     lup(i){
  36.     GameTextForAll(str,1000,6);
  37.     if(countdown==0){
  38.     GameTextForAll("~g~GO!",2000,6);
  39.     KillTimer(timer);
  40.     PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);}}
  41.     return true;
  42. }
  43.  
Advertisement
Add Comment
Please, Sign In to add comment