SA-MP Forums Archive
Help? Timeouts? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Help? Timeouts? (/showthread.php?tid=89265)



Help? Timeouts? - JonathanRulez09 - 01.08.2009

Hello, I have recently started hosting a server from my computer. I don't have the money for a host.
But lets get to my problem, Alot of times what I find happening is people will time out alot. Is there anyway I can reduce lag \ stop time outs from happening as much? I know its not my computer because I have massive space. I am using the stunt universe game mode (with my little added things)
Sometimes even I will go to login and it will say lost connection reconnecting.And then it will crash. Why is this?


Re: Help? Timeouts? - Rizard - 01.08.2009

Option 1:

kick players with ping higher then 300?
pawn Code:
public PingKick()
{
      for(new i = 0,string[256],name[24]; i < MAX_PLAYERS; i++)
      if(IsPlayerConnected(i) && (GetPlayerPing(i) > 300))
  {
            GetPlayerName(i,name,24); format(string,256,"\"%s\" has been kicked from the server. (Reason: High Ping || Max Allowed: %d)",name,Config[MaxPing]);
            SendClientMessageToAll(yellow,string); Kick(i);
      }
}
This needed at beginning of script :
pawn Code:
forward PingKick();
And this in 'OnGameModeInit()' :
pawn Code:
SetTimer("PingKick",10000,true); // gonna check every 10 seconds for to high ping
*CREDITS XTreme (taken from his xadmin FS)

Option 2:
Blame your parents/provider/internet product for the bad connection peeps having on your server.

Hopefully for you there are more experienced users with other options


Ps: first 'code' post so correct my mistakes pls