Ping & Latency
#5

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.
Reply


Messages In This Thread
Ping & Latency - by CounterTDM - 13.07.2015, 21:51
Re: Ping & Latency - by Jake187 - 13.07.2015, 22:03
Re: Ping & Latency - by n0minal - 13.07.2015, 22:04
Re: Ping & Latency - by CounterTDM - 13.07.2015, 22:32
Re: Ping & Latency - by Abagail - 13.07.2015, 23:05
Re: Ping & Latency - by CounterTDM - 13.07.2015, 23:25
Re: Ping & Latency - by Jake187 - 14.07.2015, 03:15
Re: Ping & Latency - by maxQ - 14.07.2015, 13:20

Forum Jump:


Users browsing this thread: 1 Guest(s)