SetPlayerCheckpoint

From SA-MP

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.


(playerid,Float:x,Float:y,Float:z,Float:size)
playeridID of the player
Float:xx-position for the checkpoint
Float:yy-position for the checkpoint
Float:zz-position for the checkpoint
Float:sizeSize 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);

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;
}

Related Functions

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

Personal tools