Checkpoint help
#3

If you mean like a race just have a variable which tells the CP what the next ID is and do a switch.

pawn Код:
//top of script
new
  gPlayerCP[ MAX_PLAYERS ];

//connect and disconnect
  gPlayerCP[ playerid ] = 0;
Now do like you do in OnPlayerSpawn but reset the CP:

pawn Код:
SetPlayerCheckpoint(playerid, -1394.9558,2646.2864,55.8605,3);
  gPlayerCP[ playerid ] = 0; //make sure we start from the start
Now in OnPlayerEnterCheckpoint use a switch to determine the current and next CP for the player:

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
Reply


Messages In This Thread
Checkpoint help - by aaronishello - 12.04.2009, 23:41
Re: Checkpoint help - by brett7 - 12.04.2009, 23:53
Re: Checkpoint help - by Donny_k - 13.04.2009, 00:05

Forum Jump:


Users browsing this thread: 1 Guest(s)