Posts: 56
Threads: 14
Joined: Mar 2014
Reputation:
0
Hello everyone I am very new to scripting and I have a question, how do I use GetPlayerPing so it kicks players who have over 200 ping? I attempted to script it but it gave me a bunch of errors and I have no idea where to put the functions etc and if it's meant to go in OnGameModeInit or elsewhere so yeah I have no idea about scripting and thats why I am asking I hope someone can help me with this problem.
The code so far is :
public OnPlayerConnect(playerid)
{
SetTimerEx("PingCheck", 1000, 1, "i", playerid);
return 1;
}
Posts: 3,133
Threads: 71
Joined: Dec 2013
Reputation:
0
What happens when a player has just connected with 65535 ping? They get kicked using your example. It should also be noted some players do have 200 ping when they're not even lagging just because of where they live. Pings can be as high as 800 to be fair if they are very far from the server.
Posts: 3,133
Threads: 71
Joined: Dec 2013
Reputation:
0
Even 800 can be a low value, something such as 1500 or 2000 however is definitely an issue not related to distance.
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
800 is not low. Most players from across the globe average 350 to 450.
This is also a terrible method for a ping kicker. One spike or glitch (infamous 65535) and it's game over. Take samples continuously and calculate the average. If the ping is high for a continued period of time then you can kick.