how to make a ping
#1

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)
Reply
#2

Use y_ini to save the max ping then on the ping kick use a timer or OnPlayerUpdate
pawn Код:
if(GetPlayerPing(playerid)>250)
{
Kick(playerid);
}
Reply
#3

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 Код:
#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;
}
Btw, you can't set anyone's ping atm.
Reply
#4

Quote:
Originally Posted by Lordz™
Посмотреть сообщение
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 Код:
#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;
}
Btw, you can't set anyone's ping atm.
He said ingame set xD
Reply
#5

Just search for a decent pingkicker filterscript that samples the player's ping over time. A player that usually never lags may suddenly experience a short lagspike, resulting in him getting kicked. Not fun.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)