Advertisement
Guest User

Untitled

a guest
Jul 29th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.69 KB | None | 0 0
  1.     if(strcmp(cmd, "/ping", true) == 0)
  2.     {
  3.         tmp = strtok(cmdtext, idx);
  4.         new escolha[64];
  5.         strmid(escolha, tmp, 0, strlen(tmp), 255);
  6.         new arq[256];
  7.         if(FusioN_Info[playerid][pAdmin] < ADMINISTRADOR_MASTER) { SendClientMessage(playerid, 0xFFFFFFAA, "{EB1047}Você não tem autorização para usar esse comando"); return 1; }
  8.         format(arq, sizeof(arq), "Config/config.ini");
  9.     if(!dini_Exists(arq)) { dini_Create(arq); return 1; }        
  10. dini_Set(arq,"Ping",escolha);
  11.         return 1;
  12.     }
  13.  
  14. stock PingMaximo()
  15. {
  16.     new arq[256];
  17.     format(arq, sizeof(arq), "Config/config.ini");
  18.     new Ping = dini_Int(arq,"Ping")
  19.     new pingmax[MAX_PLAYERS];
  20.     for(new playerid = 0; playerid < sizeof(MAX_PLAYERS); playerid++)
  21.     {
  22.         if(GetPlayerPing(playerid) < Ping)
  23.         {
  24.             pingmax[playerid] = 0;
  25.             return 1;
  26.         }
  27.         if(GetPlayerPing(playerid) > Ping)
  28.         {
  29.             pingmax[playerid] += 1;
  30.         }
  31.         if(pingmax[playerid] == 3)
  32.         {
  33.             new PingPlayer[MAX_PLAYERS];
  34.             PingPlayer[playerid] = GetPlayerPing(playerid);
  35.             format(gstring,sizeof(gstring),"{FFFF0A}Nick Kickado: {12F1FC}%s\n{FFFF0A}Motivo Kickado: {12F1FC}Ping Maior que %d",pNome(playerid), Ping);
  36.             ShowPlayerDialog(playerid,DIALOG_ATOA,DIALOG_STYLE_MSGBOX,"{FC12E9}Kickado",gstring,"Obrigado","");
  37.             format(string, sizeof(string), "{EBD810}AdmCmd: {3510EB}%s {0AF50A}foi kickado por causa do ping excessivo: %d/%d", playerid, PingPlayer[playerid],Ping);
  38.             SendClientMessageToAll(0xFFFFFFAA, string);
  39.             Kick(playerid);
  40.             return 1;
  41.         }
  42.     }
  43.     return 1;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement