Checkpoints
#4

https://sampwiki.blast.hk/wiki/Function:SetPlayerCheckpoint

Quote:

Returns This function doesn't return a specific value

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.
pawn Код:
new PlayerSeeCheckpoint[MAX_PLAYERS];
Okey, and now we create the first checkpoint:
pawn Код:
SetPlayerCheckpoint(playerid, -1546.3070,2651.5574,55.4233, 3.0);
PlayerSeeCheckpoint[playerid]=1;  //ID 1 is shown
Then he/she enters the checkpoint:
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;
}
I hope this will help you.

If you have any questions, feel free to ask.



Jeffry
Reply


Messages In This Thread
Checkpoints - by Spiral - 23.02.2011, 17:16
Re: Checkpoints - by Stigg - 23.02.2011, 17:18
Re: Checkpoints - by Spiral - 23.02.2011, 17:22
Re: Checkpoints - by Jeffry - 23.02.2011, 17:28

Forum Jump:


Users browsing this thread: 1 Guest(s)