SetPlayerCheckpoint
From SA-MP
[edit]
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 | ID of the player |
| Float:x | x-position for the checkpoint |
| Float:y | y-position for the checkpoint |
| Float:z | z-position for the checkpoint |
| Float:size | Size for the checkpoint |
This function does not return a specific value, it's best to simply ignore it.
SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0);
[edit]
Usage Example
//In this example the player gets a checkpoint on the spawn, //when entering the checkpoint he 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); SetPlayerInterior(playerid,3); DisablePlayerCheckpoint(playerid); return 1; }
[edit]
Related Functions
The following functions might be useful as well, as they're related to this function in one way or another.
- DisablePlayerCheckpoint: Hides a checkpoint.
- IsPlayerInCheckpoint: Checks if a player in in a checkpoint.
- SetPlayerRaceCheckpoint: Shows a race checkpoint.
