SetPlayerCheckpoint

From SA-MP Wiki

Jump to: navigation, search

SetPlayerCheckpoint


Sets a checkpoint (red circle) for a player and shows it. The function also shows it on the radar/map.


Parameters:
(playerid,Float:x,Float:y,Float:z,Float:size)
playeridThe ID of the player to set the checkpoint of
Float:xThe X coordinate to place the checkpoint at
Float:yThe Y coordinate to place the checkpoint at
Float:zThe Z coordinate to place the checkpoint at
Float:sizeThe 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.


Related Callbacks

The following callbacks might be useful, as they're related to this function in one way or another.

Personal tools
In other languages