SetPlayerRaceCheckpoint

SetPlayerRaceCheckpoint

Description:
Function SetPlayerRaceCheckpoint creates a race checkpoint. When the player enters it, the OnPlayerEnterRaceCheckpoint callback is called.
Known Bug(s):
  • If a race checkpoint is already set it will use the size of that checkpoint instead of the new one.
  • Race checkpoints created on server-created objects (CreateObject/CreatePlayerObject) will appear down on the 'real' ground, but will still function correctly.
Race checkpoints are asynchronous, meaning only one can be shown at a time. To 'stream' race checkpoints (only show them when players are close enough), use a race checkpoint streamer.


Parameters:
(playerid, type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size)
int playerid The ID of the player to set the checkpoint for.
int type Type of checkpoint.
float X X-Coordinate.
float Y Y-Coordinate.
float Z Z-Coordinate.
float nextX X-Coordinate of the next point, for the arrow facing direction.
float nextY Y-Coordinate of the next point, for the arrow facing direction.
float nextZ Z-Coordinate of the next point, for the arrow facing direction.
float size Size (diameter) of the checkpoint.


Type of checkpoint:
Type Value
0 Normal
1 Finish
2 Nothing(Only the checkpoint without anything on it)
3 Air normal
4 Air finish
5 Air (rotates and stops)
6 Air (increases, decreases and disappears)
7 Air (swings down and up)
8 Air (swings up and down)
Return Values:
  • 1: The function was executed successfully.
  • 0: The function failed to execute. This means the player specified does not exist.


Examples:

//from Yagu's race filterscript, (c) by Yagu
public SetRaceCheckpoint(playerid, Airrace, target, next)
{
     if(next == -1 && Airrace == 0)
         SetPlayerRaceCheckpoint(playerid,1,RaceCheckpoints[target][0],RaceCheckpoints[target][1],RaceCheckpoints[target][2],
                         0.0,0.0,0.0,CPsize);
     else if(next == -1 && Airrace == 1)
         SetPlayerRaceCheckpoint(playerid,4,RaceCheckpoints[target][0],RaceCheckpoints[target][1],RaceCheckpoints[target][2],
                         0.0,0.0,0.0,CPsize);
     else if(Airrace == 1)
         SetPlayerRaceCheckpoint(playerid,3,RaceCheckpoints[target][0],RaceCheckpoints[target][1],RaceCheckpoints[target][2],
                         RaceCheckpoints[next][0],RaceCheckpoints[next][1],RaceCheckpoints[next][2],CPsize);
     else
         SetPlayerRaceCheckpoint(playerid,0,RaceCheckpoints[target][0],RaceCheckpoints[target][1],RaceCheckpoints[target][2],
                         RaceCheckpoints[next][0],RaceCheckpoints[next][1],RaceCheckpoints[next][2],CPsize);
}


Related Functions
The following functions may be useful, as they are related to this function in one way or another.


Related Callbacks
The following callbacks might be useful as well, as they are related to this callback in one way or another.