Advertisement
JonathanFeitosa

Sistema de Contagem Simples

Mar 12th, 2014
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.03 KB | None | 0 0
  1. //contagem [1 ao 10] [Mensagem] em ZCMD/SSCANF
  2.  
  3.  
  4. #include <a_samp>
  5. #include <sscanf2>
  6. #include <zcmd>
  7.  
  8. new bool: Apenas1x = false;
  9.  
  10. CMD:contagem(playerid, params[])
  11. {
  12.     static Numeros, MSG[60];
  13.     if(Apenas1x) return SendClientMessage(playerid, -1, "Uma contagem jΓ‘ estΓ‘ me andamento, tente novamente mais tarde.");
  14.     if(sscanf(params, "ds[60]", Numeros, MSG))
  15.         return SendClientMessage(playerid, -1, "Use: /contagem [1 ao 10] [Mensagem]");
  16.  
  17.     if(Numeros > 10) return SendClientMessage(playerid, -1, "A contagem deve ser 1 ao 10.");
  18.     if(Numeros < 1) return SendClientMessage(playerid, -1, "A contagem deve ser 1 ao 10.");
  19.     Apenas1x = true;
  20.     Contar(Numeros);
  21.     return true;
  22. }
  23.  
  24. forward Contar(Contagem);
  25. public Contar(Contagem)
  26. {
  27.     static VBString[3];
  28.     format(VBString, 3, "%d",Contagem);
  29.     if(Contagem > 0)
  30.     {
  31.         GameTextForAll(VBString, 700, 5);
  32.         SetTimerEx("Contar",1000, false, "i", Contagem-1);
  33.     }
  34.     else GameTextForAll("Valendo !", 1000, 5), Apenas1x = false;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement