note Help Needed
This wiki is the result of an ongoing community effort — thank you all for helping!
If you want to provide changes to this page then please click here.
SetPlayerRaceCheckpoint
Description
Creates a race checkpoint. When the player enters it, the OnPlayerEnterRaceCheckpoint callback is called.
Name | Description |
---|---|
playerid | The ID of the player to set the checkpoint for |
CP_TYPE:type | Type of race checkpoint |
Float:centreX | X-Coordinate |
Float:centreY | Y-Coordinate |
Float:centreZ | 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:radius | Size (diameter) of the checkpoint |
Returns
true - The function executed successfully.
false - The function failed to execute. This means the player specified does not exist.
Examples
SetPlayerRaceCheckpoint(playerid, CP_TYPE_GROUND_NORMAL, 644.3091, 1767.0223, 4.9970, 650.6734, 1812.0367, 4.9970, 3.0);
Another example:
//from Yagu's race filterscript, (c) by Yagu
public SetRaceCheckpoint(playerid, Airrace, target, next)
{
if (next == -1 && Airrace == 0)
{
SetPlayerRaceCheckpoint(playerid, CP_TYPE_GROUND_FINISH, RaceCheckpoints[target][0], RaceCheckpoints[target][1], RaceCheckpoints[target][2], 0.0, 0.0, 0.0, CPsize);
}
else if (next == -1 && Airrace == 1)
{
SetPlayerRaceCheckpoint(playerid, CP_TYPE_AIR_FINISH, RaceCheckpoints[target][0], RaceCheckpoints[target][1], RaceCheckpoints[target][2], 0.0, 0.0, 0.0, CPsize);
}
else if (Airrace == 1)
{
SetPlayerRaceCheckpoint(playerid, CP_TYPE_AIR_NORMAL, RaceCheckpoints[target][0], RaceCheckpoints[target][1], RaceCheckpoints[target][2], RaceCheckpoints[next][0], RaceCheckpoints[next][1], RaceCheckpoints[next][2], CPsize);
}
else
{
SetPlayerRaceCheckpoint(playerid, CP_TYPE_GROUND_NORMAL, RaceCheckpoints[target][0], RaceCheckpoints[target][1], RaceCheckpoints[target][2], RaceCheckpoints[next][0], RaceCheckpoints[next][1], RaceCheckpoints[next][2], CPsize);
}
}
Notes
warning
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.
Related Functions
- SetPlayerCheckpoint: Create a checkpoint for a player.
- DisablePlayerCheckpoint: Disable the player's current checkpoint.
- IsPlayerInCheckpoint: Check if a player is in a checkpoint.
- DisablePlayerRaceCheckpoint: Disable the player's current race checkpoint.
- GetPlayerRaceCheckpoint: Get the location of the current race checkpoint.
- IsPlayerInRaceCheckpoint: Check if a player is in a race checkpoint.
- IsPlayerRaceCheckpointActive: Check if the player currently has a race checkpoint visible.
Related Callbacks
- OnPlayerEnterCheckpoint: Called when a player enters a checkpoint.
- OnPlayerLeaveCheckpoint: Called when a player leaves a checkpoint.
- OnPlayerEnterRaceCheckpoint: Called when a player enters a race checkpoint.
- OnPlayerLeaveRaceCheckpoint: Called when a player leaves a race checkpoint.