WTFCS Community | Gaming community @ since 2011

Full Version: [PAWN] Anti-High Ping
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Tutorial de ZeCo
  • In, primul rand, adugam la inceputul GM-ului:


Code:
forward PingChecker();

  • Dupa adaugam variabila:
Code:
new bool:PingChecked[MAX_PLAYERS];

Cautam `public OnGameModeInit()` si adaugam:
Code:
SetTimer("PingChecker", 60000, true);



Dupa adaugam in GameMode, la `public-uri [Image: default_21.gif]`:

Code:
public PingChecker()
{
   for(new i;i < MAX_PLAYERS;i++)
   {
       if(IsPlayerConnected(i))
       {
           if(GetPlayerPing(i) > 300 && PingChecked[i] == false) // 300 puteteti sa il schimbati, 300 este ping-ul maxim acceptat pe server.
           {
               SendClientMessage(i, -1, "ai ping prea mare fratioare.");
               PingChecked[i] = true;
           }
           if(GetPlayerPing(i) > 300 && PingChecked[i] == true) // aici lafel, 300 poate fi schimbat.
           {
               new pName[MAX_PLAYER_NAME] , string[MAX_PLAYER_NAME*2];
               GetPlayerName(i, pName, sizeof(pName));
               format(string, sizeof(string), "%s a primit kick deoarece are un PC de lemn.", pName); // mai glumim si noi.
               SendClientMessageToAll(-1, string);
               Kick(i); // aici puteti folosi si KickEx, depinde care functie folositi.
           }
       }
   }
   return 1;
}