garfield

[COD]: Banir player temporariamente

Jan 23rd, 2012
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.95 KB | None | 0 0
  1. /*
  2.         @Nome: banir player temporariamente
  3.         @Créditos: [iPs]SuYaNw
  4. */
  5.  
  6.  
  7. stock BanirTemp(pid, motivo[] = "S/M", dias)
  8. {
  9.     new N[50], d,m,a; GetPlayerName(pid, N, 24); getdate(a,m,d);
  10.     strcat(N,".BAN");
  11.     #if defined _dini_included
  12.     dini_Create(N);
  13.     dini_IntSet(N, "Dias", d+dias);
  14.     dini_Set(N, "Motivo", motivo);
  15.     #endif
  16.     Kick(pid);
  17.     return 1;
  18. }
  19.  
  20. stock VerifyPlayer(playerid)
  21. {
  22.     new N[50], d,m,a; GetPlayerName(playerid, N, 24); getdate(a, m, d);
  23.     strcat(N,".BAN");
  24.     #if defined _dini_included
  25.     if(fexist(N))
  26.     {
  27.         if(dini_Int(N, "Dias") < d)
  28.         {
  29.             new str[128];
  30.             format(str, sizeof(str),"Faltam %d dias para você ser desbanido. ( Motivo: %s )", dini_Int(N, "aTDia"), dini_Get(N, "Motivo"));
  31.             SendClientMessage(playerid, -1, str);
  32.             Kick(playerid);
  33.         }
  34.         if(dini_Int(N, "Dias") == d)
  35.         {
  36.             fremove(N);
  37.         }
  38.     }
  39.     #endif
  40. }
  41.  
  42.  
  43. // Como Usar:
  44. BanirTemp(playerid, "No-reload", 3); // Banirá o player por No-reload por 3 dias.
Advertisement
Add Comment
Please, Sign In to add comment