24.12.2012, 08:22
You don't need to use y_ini or any file systems for saving the maximum ping of the server. A simple define is enough or a variable.
Btw, you can't set anyone's ping atm.
pawn Код:
#define MAX_PING 54321 //Add your value.
public OnFilterScriptInit()
{
SetTimer("DetectPing", 2000, true); //A timer would be better in handling ping detection.
return 1;
}
forward DetectPing();
public DetectPing()
{
for(new i; i< GetMaxPlayers(); i++)
{
if(!IsPlayerConnected(i)); continue;
if(GetPlayerPing(playerid) >= MAX_PING) return Kick(playerid);
}
return 1;
}