Checkpoint help
#4

There was a good example in the old area51.pwn which came with the sa-mp package :/

Its quite easy, you create an player array

pawn Код:
stock gPlayerCheckpointStatus[MAX_PLAYERS];
and you define some checkpoints

pawn Код:
enum {
    CHECKPOINT_NONE,
    CHECKPOINT_ONE,
    CHECKPOINT_TWO
}
and than if you set a checkpoint you just set the array to

pawn Код:
gPlayerCheckpointStatus[playerid] = CHECKPOINT_ONE;

SetPlayerCheckpoint(playerid, ...);
in the end if you disable the checkpoint you need to reset the array

pawn Код:
gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;

DisPlayerPlayerCheckpoint(playerid);
And in OnPlayerEnterCheckpoint

pawn Код:
switch(gPlayerCheckpointStatus[playerid]) {

    case CHECKPOINT_ONE: {}

    case CHECKPOINT_TWO: {}

    default: {
        gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
        DisPlayerPlayerCheckpoint(playerid);
    }

}
The timer for the explosion should be clear, if not read the wiki page about SetTimerEx
Reply


Messages In This Thread
Checkpoint help - by HydraX - 17.06.2011, 15:27
AW: Checkpoint help - by Nero_3D - 17.06.2011, 15:33
Re: Checkpoint help - by HydraX - 17.06.2011, 15:37
AW: Checkpoint help - by Nero_3D - 17.06.2011, 16:02
Re: Checkpoint help - by HydraX - 17.06.2011, 16:06
Re: Checkpoint help - by HydraX - 17.06.2011, 16:25

Forum Jump:


Users browsing this thread: 3 Guest(s)