29.07.2017, 23:02
Try it without the timer repeating.
PHP код:
// Somewhere in your script...
PlayerTemp[playerid][CPTimer] = SetTimerEx("TracenCP", 2000, false, "dd", playerid, targetID);
function:TracenCP(playerid, targetID)
{
if(IsPlayerInAnyInterior(targetID) || PlayerTemp[targetID][phoneoff] != 0 || !IsPlayerConnected(targetID))
{
DisablePlayerCheckpoint(playerid);
SendClientWarning(playerid, "Tracing failed.");
return 1;
}
new Float:position[3];
GetPlayerPos(targetID, position[0], position[1], position[2]);
SetPlayerCheckpoint(playerid, position[0], position[1], position[2], 2.0);
PlayerTemp[playerid][CPTimer] = SetTimerEx("TracenCP", 2000, false, "dd", playerid, targetID);
return 1;
}