SA-MP Forums Archive
Checkpoint - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Checkpoint (/showthread.php?tid=68558)



Checkpoint - Schock - 11.03.2009

fixed


Re: Checkpoint - pspleo - 11.03.2009

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


Re: Checkpoint - Schock - 11.03.2009

.