[CAMPANIE STAFF]Cautam moderatori si designeri activi!
Welcome to WTFCS Community Forums!
Servere gaming la super-preturi! [HOSTING SERVICE]
-->






[PAWN] Anti-High Ping
Author : mihay111, Category : Tutoriale, 0 Replyes, 705 Views
EVALUATE THIS TOPIC
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
1 Guest(s)
Moderator
     
577
POSTS
452
THREADS
190
REPUTATION
Male
Sex

WtfCs Coins: 0.15[w]

Suit Member
11-13-2020, 03:09 PM
#1
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;
}


Messages In This Thread
[PAWN] Anti-High Ping - by mihay111 - 11-13-2020, 03:09 PM

Forum Jump: