For what your trying to do here, you need to name and shame your checkpoints.
Example:
Global Definition is KEY!
pawn Код:
#define MAX_ENTEREXIT 20
new EnterExitCheckpoints[MAX_ENTEREXIT];
Note above that I'm keeping the groups small this helps a lot when you get to increase the size of your server.
You can even do this singly:
pawn Код:
OnGameModeInit()
{
EnterExitCheckpoints[0] = CreateDynamicCP(0.0, 0.0, 0.3, 3.0, -1, -1, playerid);
EnterExitCheckpoints[1] = CreateDynamicCP(0.0, 0.0, 0.3, 3.0, -1, -1, playerid);
PoliceLSEnter = CreateDynamicCP(0.0, 0.0, 0.3, 3.0, -1, -1, playerid);
return 1;
}
Here we are telling the server which checkpoint is which is at what location and what identifying array we are assigning it to.
Use these to check?
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == EnterExitCheckpoints[0]) return SetPlayerPos();
if(checkpointid == EnterExitCheckpoints[1]) return SetPlayerPos();
if(checkpointid == PoliceLSEnter) return SetPlayerPos();
return 1;
}
Checking which checkpoint the player is in and then acting upon this here we check is he is in the checkpoints 0, and 1. If he is set his position to wherever.
I also recommended using Incognitos Streamer too, ad you'll soon drive your server towards a brick wall using the standard checkpoint system.
Also note above I am returning when we find the checkpoint the player is in, I personally recommend you ALWAYS return as players can only be in one checkpoint at once... unless you've made a bo bo. In which case he will trigger one first. This saves server time checking things which you already know aren't possible.