Detecting desynced players
#1

Just wondering if anyone knows how to detect desynced players via scripting. What would need to be put into the script, etc? Like the desynced detection script on LS-RP.
Reply
#2

I think you can use this function to detect if a player is desynced.

https://sampwiki.blast.hk/wiki/NetStats_PacketLossPercent
Reply
#3

Yea I tried inputting packet loss, but I don't think that's what causes it, as I was trying it on myself - with over 1.0 packet_loss, yet I was still able to see server dialogs etc. I'm sure being desynced removes your ability to see dialogs - correct me if I'm wrong. I tried different packet_loss values, such as 0.5, 1.0, and eventually, 2.0 - I went to 2.0 for a minute, yet I could still see dialogs. Any other ideas?
Reply
#4

According to the wiki(though I have no idea how true this information is), the function isn't very accurate:


The wiki(though I also don't really have any information about this either) also suggests that this snippet HAS more accuracy:
pawn Код:
stock GetPlayerPacketloss(playerid,&Float:packetloss)
{
    /* Returns the packetloss percentage of the given playerid - Made by Fusez */

    if(!IsPlayerConnected(playerid)) return 0;

    new nstats[400+1], nstats_loss[20], start, end;
    GetPlayerNetworkStats(playerid, nstats, sizeof(nstats));

    start = strfind(nstats,"packetloss",true);
    end = strfind(nstats,"%",true,start);

    strmid(nstats_loss, nstats, start+12, end, sizeof(nstats_loss));
    packetloss = floatstr(nstats_loss);
    return 1;
}
(http://forum.sa-mp.com/showpost.php?...&postcount=984)

But to get to the point, it should be detected through packetloss, though the function may be at fault if your having trouble detecting it properly.
Reply
#5

Alright. Thank you Abagail & rappy93. Gonna try to detect it correctly via the function itself and the snippet. If anyone has anything else that can help me correctly detect the desynced state, please feel free to post.
Reply
#6

Good luck man.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)