13.04.2009, 00:05
If you mean like a race just have a variable which tells the CP what the next ID is and do a switch.
Now do like you do in OnPlayerSpawn but reset the CP:
Now in OnPlayerEnterCheckpoint use a switch to determine the current and next CP for the player:
pawn Код:
//top of script
new
gPlayerCP[ MAX_PLAYERS ];
//connect and disconnect
gPlayerCP[ playerid ] = 0;
pawn Код:
SetPlayerCheckpoint(playerid, -1394.9558,2646.2864,55.8605,3);
gPlayerCP[ playerid ] = 0; //make sure we start from the start
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
DisablePlayerCheckpoint(playerid);
switch ( gPlayerCP[ playerid ] )
{
case 0 :
{
GameTextForPlayer(playerid, "~w~" Reached The First Location! ,3000,4);
SetPlayerCheckpoint(playerid, -2240.6870,2351.4380,4.9785,3);
gPlayerCP[ playerid ] ++; //it now equals 1 for the next case
}
case 1 :
GameTextForPlayer(playerid, "~w~" Reached The Second Location! ,3000,4);
SetPlayerCheckpoint(playerid, COORDS_HERE ,,,,,3);
gPlayerCP[ playerid ] ++; //it now equals 2 for the next case
}
case 2 :
//and so on
}
//rest of callback