Setplayercheckpoint
#3

Alternatively, you can do something like this:
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;
}
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.
Reply


Messages In This Thread
Setplayercheckpoint - by JonesyFoCoTDM - 05.09.2013, 10:05
Re: Setplayercheckpoint - by FiReAlEx - 05.09.2013, 10:14
Re: Setplayercheckpoint - by Eyce - 05.09.2013, 13:01

Forum Jump:


Users browsing this thread: 1 Guest(s)