It seems that what you need is not to create a checkpoint, which you use SetPlayerCheckpoint for.
Well, to use these all you need is to create a new array at the beggining of your gamemode, just like:
pawn Код:
new CheckpointStatus[MAX_PLAYERS];
Then you use the function SetPlayerCheckpoint in whatever coordinates you want it to be:
[pawn]SetPlayerCheckpoint(playerid, X,Y,Z, size)
//CheckpointStatus[playerid]=1; Do this if you want this checkpoint to do some special action when you enter it such as teleporting your player,giving him money/guns, whatever you want to script later.
[/pawm]
Then you go under the callback OnPlayerEnterCheckpoint(playerid) and use it like this:
pawn Код:
OnPlayerEnterCheckpoint(playerid)
{
switch(CheckpointStatus[playerid])
{
case 0: DisablePlayerCheckpoint(playerid); //Nothing happens and the checkpoint disappears.
case 1:
{
//Write here whatever code you want. This is what will happen if the CheckpointStatus is 1 and the player enters a checkpoint.
}
}
return 1;
}
About creating checkpoints for the entrance of shops and stuff, well for that you would need a streamer. I recommend Incognito's Streamer. After that you just add checkpoints in OnGameModeInit and use the callback given in the streamer