Ping

Started by Cool, May 19, 2016, 05:00 PM

Previous topic - Next topic

Cool

i dont want to kick player on high ping i want to stop from spawn if his ping higher then 750 with simple method no timer can any one one tell me how :P

KAKAN

function onPlayerRequestSpawn( player )
{
  if( player.Ping > 750 ) return 0;
}
Will stop him/her for spawning, if already spawn, then you sux!
oh no

Mötley

KAKAN code is basically what I was going to suggest,

But I would and a exclusion for admins like the code I have so either way with you or your admins they can still monitor the server regardless.

That's considered a high ping threshold and is a better method than some of the servers I have played on if you have a normal ping kick,
As In if you have a normal server ping kick its really good to use this method as you should get the players average ping instead of kicking them for anything above say 600,
that code will monitor there ping for a given amount of time and if they cant get it any lower it kicks the player
This is good methods to know for ping related issues..


but I know you said no timer but you could steal some stuff from this. when referring to anything ping related, and or use it for an actual ping kick
       
ping_kick <- array(GetMaxPlayers(), 0);

function Second() {
 
  for (local i=0;i<GetMaxPlayers();i++) {
    local player = FindPlayer(i);
   
    if (player) {
      if (player.ID == i) {       
        //ping
        if (player.Ping > 600 && admin[i] == 0) {
          ping_kick[i]++;
          if (ping_kick[i] > 30) {
            Message("[#ff0000]"+player.Name+" has been kicked for high ping ("+player.Ping+")");
            KickPlayer(player); 
          }
        }
        else {
          ping_kick[i] = 0;
        }
        //ping

function onScriptLoad() {
   
  NewTimer( "Second", 1000, 0);

vito

Checking every second all players? xD

Cool

Quote from: KAKAN on May 19, 2016, 05:02 PMfunction onPlayerRequestSpawn( player )
{
  if( player.Ping > 750 ) return 0;
}
Will stop him/her for spawning, if already spawn, then you sux!
Thanks i dont think about it so now thinking about drown :D