Detecting movement
#3

pawn Код:
#include <YSI\y_timers>

new Float:oldPos[MAX_PLAYERS][3];

Timer:AFKUpdate[120000]() {
    new Float:tempPos[3];
    foreach(Player, playerid) {
        GetPlayerPos(playerid, tempPos[0], tempPos[1], tempPos[2]);
        if(tempPos[0] == oldPos[playerid][0] && tempPos[1] == oldPos[playerid][1] && tempPos[2] == oldPos[playerid][2]) {
            // AFK code
        }
        GetPlayerPos(playerid, oldPos[playerid][0], oldPos[playerid][1], oldPos[playerid][2]);
    }
}
Reply


Messages In This Thread
Detecting movement - by sim_sima - 20.10.2011, 21:04
Re: Detecting movement - by Kingunit - 20.10.2011, 22:42
Re: Detecting movement - by SuperViper - 21.10.2011, 01:02
Re: Detecting movement - by sim_sima - 21.10.2011, 10:21

Forum Jump:


Users browsing this thread: 2 Guest(s)