How to check is player pos has changed?
#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


Messages In This Thread
How to check is player pos has changed? - by ajwar - 18.02.2011, 13:50
Re: How to check is player pos has changed? - by RyDeR` - 18.02.2011, 15:20
Re: How to check is player pos has changed? - by ajwar - 18.02.2011, 15:41

Forum Jump:


Users browsing this thread: 1 Guest(s)