23.02.2011, 17:28
https://sampwiki.blast.hk/wiki/Function:SetPlayerCheckpoint
The code by Stigg won't work.
I will give you one in some minutes.
__________________________________________________ ___________________________________________
__________________________________________________ ___________________________________________
Okey, now this will work:
First of all we create a new variable for each player, so we can let the server know, which checkpoint the player is currently able to see.
Okey, and now we create the first checkpoint:
Then he/she enters the checkpoint:
I hope this will help you.
If you have any questions, feel free to ask.
Jeffry
Quote:
Returns This function doesn't return a specific value |
I will give you one in some minutes.
__________________________________________________ ___________________________________________
__________________________________________________ ___________________________________________
Okey, now this will work:
First of all we create a new variable for each player, so we can let the server know, which checkpoint the player is currently able to see.
pawn Код:
new PlayerSeeCheckpoint[MAX_PLAYERS];
pawn Код:
SetPlayerCheckpoint(playerid, -1546.3070,2651.5574,55.4233, 3.0);
PlayerSeeCheckpoint[playerid]=1; //ID 1 is shown
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
//We switch between the different CPs
switch(PlayerSeeCheckpoint[playerid])
{
case 1:
{
//Here the player has entered the checkpoint from upon (ID 1)
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, -1481.1399,2670.2441,55.4200, 3.0);
PlayerSeeCheckpoint[playerid]=2; //New he/she sees ID 2
}
case 2:
{
//He has entered the checkpoint 2 now.
//Add anything, but if you show a new checkpoint, don't forget to give him a ID.
//And watch out that no ID is twice. ;)
}
}
return 1;
}
If you have any questions, feel free to ask.
Jeffry
![Cool](images/smilies/cool.gif)