SA-MP Forums Archive
PVar randomly resetting? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: PVar randomly resetting? (/showthread.php?tid=235591)



PVar randomly resetting? - Antonio [G-RP] - 05.03.2011

This code runs on a 1 second timer, and from the print I can see it climbing up and up (7,8,9..)
The problem is, it will reset and go back to 1 sometimes.

pawn Код:
if(NewPos[i][0] == OldPos[i][0] && NewPos[i][1] == OldPos[i][1] && NewPos[i][2] == OldPos[i][2])
{
     SetPVarInt(i, "AFKTime", GetPVarInt(i, "AFKTime") + 1);
     printf("Player AFK time %d", GetPVarInt(i, "AFKTime"));
}
Any ideas as to why?