afk detect
#2

Well you do something like this
Save the players position and then lets say after 2 minutes check if the players is in the same position

EXAMPLE
pawn Код:
//add this at the top
new Float:PosY[MAX_PLAYERS], Float:PosZ[MAX_PLAYERS], Float:PosA[MAX_PLAYERS] Float:PosX[MAX_PLAYERS];
//Add This wherever you want to chech for the player not moving
SetTimer("SavePlayerPos",1000,false);

//then put this in the bottom of your script
forward SavePlayerPos(playerid);
public SavePlayerPos(playerid)
{
GetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
//Now set a timer lets say 1 minute to check if the player is in the same position
SetTimer("CheckPlayerPos",60000,false);
return 1;
}
forward CheckPlayerPos(playerid);
public CheckPlayerPos(playerid)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
if(x && y && z == PosX[playerid] && PosY[playerid] && PosZ[playerid])
{
SendClientMessage(playerid,RED,"You have not moved in 1 minute!!!");
}
return 1;
}
UnTested and is just and example but im preaty sure it will work!
Reply


Messages In This Thread
afk detect - by Amine_Mejrhirrou - 01.03.2011, 19:38
Re: afk detect - by park4bmx - 01.03.2011, 19:55
Re : afk detect - by Amine_Mejrhirrou - 01.03.2011, 22:24
Re : afk detect - by Amine_Mejrhirrou - 01.03.2011, 23:23
Re: afk detect - by Antonio [G-RP] - 01.03.2011, 23:33
Re: afk detect - by Mean - 02.03.2011, 09:37
Re : afk detect - by Amine_Mejrhirrou - 02.03.2011, 12:24

Forum Jump:


Users browsing this thread: 1 Guest(s)