29.01.2015, 22:00
You could use SetTimerEx, you'll only need to adjust the interval of the timer and the range to your own liking.
pawn Код:
stock SetPlayerPosEx(playerid, Float:x, Float:y, Float:z)
{
pInfo[playerid][pOldPos][0] = x;
pInfo[playerid][pOldPos][1] = y;
pInfo[playerid][pOldPos][2] = z;
SetPlayerPos(playerid, x, y, z);
SetTimerEx("CheckNewPosition", 1000, 0, "u", playerid);
}
forward CheckNewPosition(playerid);
public CheckNewPosition(playerid)
{
if(!IsPlayerInRangeOfPoint(playerid, 7.0, pInfo[playerid][pOldPos][0], pInfo[playerid][pOldPos][1], pInfo[playerid][pOldPos][2]))
{
//Player is more than 7 units away within 1 second after teleporting.
}
return 1;
}