Checkpoints?
#1

Hi, I am wanting to know how I can use multiple "IsPlayerInCheckPoints" in the OnPlayerEnterCheckpoint. This is the code I have now, the first one works fine but the second checkpoint doesn't work.

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    new rand = random(sizeof(RandAirports));
    if(IsPlayerInCheckpoint(playerid) == airportcheckpoint)
    {
        DisablePlayerCheckpoint(playerid);
        airportcheckpoint1 = SetPlayerCheckpoint(playerid, RandAirports[rand][3], RandAirports[rand][4], RandAirports[rand][5], 2.5);
    }
    else if(IsPlayerInCheckpoint(playerid) == airportcheckpoint1)
    {
        DisablePlayerCheckpoint(playerid);
        SendClientMessage(playerid, COLOR_WHITE, "Radio: Well done, you have completed the travel.");
        PlayerInfo[playerid][pLevel] += 5;
        PlayerInfo[playerid][pMoney] += random(2555)+1000;
        SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
        GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
        SaveAccount(playerid);
    }
    return 1;
}
Reply
#2

That's not how you use that function. IsPlayerInCheckpoint just returns true if the player is in any checkpoint. And that would be unnecessary to check under OnPlayerEnterCheckpoint because obviously, they are in one. If you want more than one checkpoint, you need a checkpoint streamer.
Reply
#3

Can't be done. Checkpoints don't have ids..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)