30.06.2009, 09:45
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
}
}