SetPlayerCheckpoint
From SA-MP Wiki
SetPlayerCheckpoint
Sets a checkpoint (red circle) for a player and shows it. The function also shows it on the radar/map.
(playerid,Float:x,Float:y,Float:z,Float:size)
| playerid | The ID of the player to set the checkpoint of |
| Float:x | The X coordinate to place the checkpoint at |
| Float:y | The Y coordinate to place the checkpoint at |
| Float:z | The Z coordinate to place the checkpoint at |
| Float:size | The size of the checkpoint |
This function does not return a specific value.
Important Note: You can only show one checkpoint at a time. If you need more, create the checkpoints only when the player is near.
// In this example the player's checkpoint will be set when they spawn. // On entering the checkpoint they will receive $1000 and the checkpoint will be disabled. public OnPlayerSpawn(playerid) { SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0); return 1; } public OnPlayerEnterCheckpoint(playerid) { GivePlayerMoney(playerid, 1000); DisablePlayerCheckpoint(playerid); return 1; }
Related Functions
The following functions might be useful as well, as they're related to this function in one way or another.
- DisablePlayerCheckpoint: Disable the player's current checkpoint.
- IsPlayerInCheckpoint: Check if a player is in a checkpoint.
Related Callbacks
The following callbacks might be useful, as they're related to this function in one way or another.
- OnPlayerEnterCheckpoint: Called when a player enters a checkpoint.
- OnPlayerLeaveCheckpoint: Called when a player leaves a checkpoint.
