Detect if a Player has left their Position.
#4

Untested, but somethign like this.
pawn Код:
//top
new Timer[MAX_PLAYERS];

//onplayercommandtext
if(strcmp(cmdtext, "/holdup", true) == 0)
{
  new Float:x, Float:y, Float:z;
  GetPlayerPos(playerid, x, y, z);
  SendClientMessage(playerid, color, "Don't move from this position or the robbery will fail!");
  Timer[playerid] = SetTimerEx("LeftArea", 500, 1, "ifff", playerid, x, y, z);
  return 1;
}

//after main()
forward LeftArea(playerid, Float:X, Float:Y, Float:Z);
public  LeftArea(playerid, Float:X, Float:Y, Float:Z)
{
  if(!PlayerToPoint(5, playerid, X, Y, Z);
  {
   KillTimer(Timer[playerid]);
   SendClientMessage(playerid, color, "You left the area! The robbery is a bust!");
   //your code for stoping, w/e
  }
}
Reply


Messages In This Thread
Detect if a Player has left their Position. - by Abernethy - 30.06.2009, 09:36
Re: Detect if a Player has left their Position. - by Grim_ - 30.06.2009, 09:37
Re: Detect if a Player has left their Position. - by Abernethy - 30.06.2009, 09:41
Re: Detect if a Player has left their Position. - by Grim_ - 30.06.2009, 09:45

Forum Jump:


Users browsing this thread: 3 Guest(s)