Checkpoint
#1

fixed
Reply
#2

It won't, SetPlayerCheckpoint won't return a value (which means you can't assign an id for it.)

To solve, try with player state:

pawn Код:
#define CHECKPOINT_STATE_ENTER_TURISMO
#define CHECKPOINT_STATE_ENTER_SULTAN
new PlayerCheckpointState[MAX_PLAYERS]; //create new array of players

//OnPlayerConnect maybe?
SetPlayerCheckpoint(playerid, ...);
PlayerCheckpointState[playerid] = CHECKPOINT_STATE_ENTER_TURISMO; //so the game know that if the player enter a checkpoint with this variable set to CHECKPOINT_STATE_ENTER_TURISMO, it will do something special


//OnPlayerEnterCheckpoint
public OnPlayerEnterCheckpoint(playerid) //you probably notice there isn't an checkpointid here.
{
    if(PlayerCheckpointState[playerid] == CHECKPOINT_STATE_ENTER_TURISMO)
    {
        //do what you want here! For example fix the car
    }
    else if(PlayerCheckpointState[playerid] == CHECKPOINT_STATE_ENTER_SULTAN)
    {
        //maybe something else?
    }
    return 1;
}
Good luck.

Leopard
Reply
#3

.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)