05.09.2013, 13:01
Alternatively, you can do something like this:
Check if the player is really near the range of the checkpoint. Disable the player's current checkpoint upon entering just for assurance. Then set the new player checkpoint and also it's variable for the next validation.
pawn Код:
new playerCheckpoint[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
playerCheckpoint[playerid] = 0;
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, range, x, y, z) && playerCheckpoint[playerid] == 1)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, x, y, z, size);
playerCheckpoint = 2;
}
else if(IsPlayerInRangeOfPoint(playerid, range, x, y, z) && playerCheckpoint[playerid] == 2)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, x, y, z, size);
playerCheckpoint = 3;
}
return 1;
}