SA-MP Forums Archive
OnPlayerUpdate Ping Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerUpdate Ping Problem (/showthread.php?tid=631483)



OnPlayerUpdate Ping Problem - MyUndiesSmell - 30.03.2017

The code works fine but it won't tell the player before he gets kicked.
Код:
         new string[256];
	 format(string, sizeof(string), "SERVER: %s has been kick for Excessive Ping!", GetName(playerid));
         if(GetPlayerPing(playerid) > 50)
         {
	 Kick(playerid);
	 SendClientMessageToAll(COLOR_SERVER, string);
	 }



Re: OnPlayerUpdate Ping Problem - Toroi - 30.03.2017

https://sampwiki.blast.hk/wiki/Kick

Quote:

As of SA-MP 0.3x, any action taken directly before Kick() (such as sending a message with SendClientMessage) will not reach the player. A timer must be used to delay the kick.

Also, if the thing above was not enough, you're kicking him first before sending the message.