10.08.2016, 18:56
Quote:
How can I fix this then?
Here's the part of PlayerCheck, the timer repeats every second. Code:
forward PlayerCheck(); public PlayerCheck() { foreach (new i : Player) { if (NetStats_PacketLossPercent(i) >= 0.5 && !PlayerData[i][pDesynced]) PlayerData[i][pDesynced] = true; if (PlayerData[i][pDesynced]) GameTextForPlayer(i, "~w~You are desynced~n~Please relog as soon~n~as possible", 1200, 3); } } |
Testing code for debugging: using printf if the message is not sent.
Code:
forward PlayerCheck(); public PlayerCheck() { foreach (new i : Player) { if (NetStats_PacketLossPercent(i) >= 0.5 && !PlayerData[i][pDesynced]) PlayerData[i][pDesynced] = true; if(PlayerData[i][pDesynced] && GetPlayerPing(i) >= 500) SendClientMessage(playerid, -1, "Lost bravo"); printf("%d has lost bravo", i); if(NetStats_PacketLossPercent(i) >= 1.0) SendClientMessage(playerid, -1, "Lost alpha"); printf("%d has lost alpha", i); if (PlayerData[i][pDesynced]) GameTextForPlayer(i, "~w~You are desynced~n~Please relog as soon~n~as possible", 1200, 3); printf("%d has lost junior", i); } }