24.12.2012, 07:04
how to make a /setping how like i pick 250 Admin Derick Has set ping to 250
if they ping go high Your ping is high (Kicked)
if they ping go high Your ping is high (Kicked)
if(GetPlayerPing(playerid)>250)
{
Kick(playerid);
}
#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;
}
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.
pawn Код:
|