03.02.2012, 21:44
What is the best way to check if someone is AFK?
Check the players coordinates, using GetPlayerPos.
Initialize a timer of 'x' seconds/minutes, checking his coordinates. If they match the previous coordinates. He hasn't moved. Punish/Warn, as you please. |
new Float:Pos[3], Float:OldPos[3], Float:NewPos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
OldPos[0] = Pos[0];
OldPos[1] = Pos[1];
OldPos[2] = Pos[2];
GetPlayerPos(playerid, NewPos[0], NewPos[1], NewPos[2]);
if(OldPos[0] == NewPos[0]))
{
print("Player stopped moving");
}
if(OldPos[0] == NewPos[0]))
if(OldPos[0] == NewPos[0]))