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


Messages In This Thread
Checkpoints? - by Luis- - 17.09.2011, 23:48
Re: Checkpoints? - by Backwardsman97 - 17.09.2011, 23:51
Re: Checkpoints? - by RelaxCafe - 18.09.2011, 00:02

Forum Jump:


Users browsing this thread: 1 Guest(s)