Create checkpoint
#2

SetPlayerCheckpoint
pawn Код:
new CurrentPlayerCheckpoint[MAX_PLAYERS]=0;
public OnPlayerSpawn(playerid)
{
    SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0);
    CurrentPlayerCheckpoint[playerid] = 1;//first checkpoint
    return 1;
}
 
public OnPlayerEnterCheckpoint(playerid)
{
    if(CurrentPlayerCheckpoint[playerid] == 1)// If he enters the first checkpoint
    {
        CurrentPlayerCheckpoint[playerid] = 2;//The second checkpoint
        DisablePlayerCheckpoint(playerid);
        SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0);//Another one
    }
    if(CurrentPlayerCheckpoint[playerid] == 2) //if he enters the second one
    {
        //do something
        DisablePlayerCheckpoint(playerid);//hide checkpoint from his map.
        CurrentPlayerCheckpoint[playerid] = 0; //reset the variable back to nothing.
    }
    return 1;
}
Reply


Messages In This Thread
Create checkpoint - by Shinta307 - 24.06.2014, 05:40
Re: Create checkpoint - by SilentSoul - 24.06.2014, 06:57

Forum Jump:


Users browsing this thread: 1 Guest(s)