05.09.2013, 10:05
How do you set a new checkpoint upon entering a current one? I'm wanting to create a route with multiple checkpoints to get you from A to B basically.
Thanks in advance.
Thanks in advance.
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;
}