Skip to content

checkpoints.create

Puts one of the game’s checkpoints in the world, with a blip on the radar: a delivery point, a job’s next stop, a door. You can have any number, for everyone or for chosen players, apart from each player’s race checkpoint. The server sends playerEnteredCheckpoint and playerLeftCheckpoint; nothing else happens unless your gamemode does it. Each player sees the nearest 8.

checkpoints.create(settings: CheckpointSettings): Promise<ActionResult>
Name Type Description
settings.position Vector3 Where it stands, [x, y, z].
settings.size number Optional. Its radius in metres, up to 1000. Defaults to 2. It counts 10 m up and down.
settings.colorRgba number Optional. Its color, 0xRRGGBBAA. Defaults to the game’s see-through red.
settings.range number Optional. How near a player must be to see it, in metres, up to 6000. Defaults to 200; 0 is the whole map. The events come at any distance.
settings.blip boolean Optional. A radar blip in its color. Defaults to true.
settings.interior number Optional. The interior it is in: 0 outside (the default), 1 to 18 an interior’s, 13 every interior.
settings.virtualWorld number Optional. The virtual world it is in (default 0), or virtualWorlds.every for every one.
settings.visible boolean Optional. false hides it, and it sends no events while hidden. Defaults to true.
settings.players PlayerTarget[] | null Optional. Only these players see it, while they are connected. Left out or null: everyone.

A promise of an ActionResult: applied with the new checkpoint’s ID in createdId, or rejected with invalid-position, invalid-radius, invalid-range, invalid-area, invalid-world, invalid-colour, invalid-value or invalid-players. A player in players who has left gives player-not-found. The server keeps up to 4,096 text labels, map icons, checkpoints and areas together, at most 1,024 of them checkpoints and areas (host-marker-limit when full).

Players who join later, or come back, see it too. One for chosen players is destroyed when the last of them leaves: make it again when they come back. All of them go when your gamemode stops or reloads.

gamemodes/my-mode.ts
import { checkpoints, server } from "nativemp";
const result = await checkpoints.create({ position: [1770, -2490, 13.5], size: 3 });
if (result.status === "applied") server.log(`Checkpoint ${result.createdId} is up`);