01.03.2011, 19:55
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
UnTested and is just and example but im preaty sure it will work!
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;
}