How to check is player pos has changed?
#1

Hi i wondering about how to make a check with pVars which will check is player position has changed? I will use this in timer...
Reply
#2

The part where you get the positions and save the positions in with PVars.
pawn Код:
new
    Float: pPos[3]
;
GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);

SetPVarFloat(playerid, "posX", pPos[0]);
SetPVarFloat(playerid, "posY", pPos[1]);
SetPVarFloat(playerid, "posZ", pPos[2]);
The part where you check if it's changed.
pawn Код:
new
    Float: pPos[3]
;
GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);

if(pPos[0] != GetPVarFloat(playerid, "posX") || pPos[1] != GetPVarFloat(playerid, "posY") || pPos[2] != GetPVarFloat(playerid, "posZ"))
{
    /* Position is changed... */
}
Another options is to use floatcmp.
Reply
#3

thank's
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)