Quote:
Originally Posted by Abagail
Well you can see if a player is lagging or more importantly desynced based on the packet loss of the player. You can use the GetPlayerPacketLoss(or the more accurate alternative suggested on the wiki page).
pawn Код:
// run this code maybe every 10 seconds or so? new Float: packetloss; GetPlayerPacketLoss(playerid, packetloss);
if(packetloss > 0.1) // player is most likely lagging { }
else if(packetloss > 1.0) // player's network is lagging badly and dropping a lot of packets { Kick(playerid); }
Though as I said, the wiki reports the function to not be so accurate and recommend's RedFusion's method(though I have no experience for the functions, so I don't know if any of them are all that accurate)
http://forum.sa-mp.com/showpost.php?...&postcount=984
This will not detect FPS or game related lag; only network based lag. You can also use FPS functions to check if the player's game is lagging or not and factor that in aswell.
|
+1, thanks for providing me with some source into how to control possible de-synced players. Although I have not experienced this issue yet, it will be implemented to ensure the issue is as little as it can be. Appreciated.