Advertisement
garfield

[COD]: Sistema de contagem progressiva

Jul 16th, 2011
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.97 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new Contar = 5;
  4. public OnPlayerCommandText(playerid, cmdtext[])
  5. {
  6.     if(!strcmp(cmdtext,"/contagem", true))
  7.     {
  8.         StartCount(playerid);
  9.         return 1;
  10.     }
  11.     return 0;
  12. }
  13.  
  14. forward StartCount(p);
  15. public StartCount(p)
  16. {
  17.     static
  18.         Float: _X,
  19.         Float: _Y,
  20.         Float: _Z,
  21.         _str[100]
  22.     ;
  23.     GetPlayerPos(p, Float:_X, Float:_Y, Float:_Z);
  24.     format(_str, sizeof(_str),"%d", Contar);
  25.     if(Contar == 0)
  26.     {
  27.         for(new i; i <= MAX_PLAYERS; ++i)
  28.         {
  29.             if(IsPlayerConnected(i))
  30.             {
  31.                 if(IsPlayerInRangeOfPoint(i, 5.0,Float:_X, Float:_Y, Float:_Z))
  32.                 {
  33.                     GameTextForPlayer(i, "~g~Go Go Go!",2500, 3);
  34.                 }
  35.             }
  36.         }
  37.         return Contar=5, true;
  38.     }
  39.     for(new i; i <= MAX_PLAYERS; ++i)
  40.     {
  41.         if(IsPlayerConnected(i))
  42.         {
  43.             if(IsPlayerInRangeOfPoint(i, 5.0,Float:_X, Float:_Y, Float:_Z))
  44.             {
  45.                 GameTextForPlayer(i, _str,2500, 3);
  46.                 SetTimerEx("StartCount", 1000, false, "id",i,Contar);
  47.             }
  48.         }
  49.     }
  50.     return Contar--;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement