playerEnteredCheckpoint
Tells your gamemode that a player came into one of your checkpoints, on foot or in a vehicle; a fast car that passed through one between two positions counts too. Only for a player the checkpoint is for, in its interior and virtual world, while it is visible. Nothing else happens unless your gamemode does it.
Renamed in 0.28 from checkpointEnter; see renamed names.
Signature
Section titled “Signature”server.on("playerEnteredCheckpoint", ({ player, checkpoint }) => void)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
player |
PlayerSnapshot |
The player. |
checkpoint |
Checkpoint |
The checkpoint, from checkpoints.create. |
Example
Section titled “Example”import { checkpoints, players, server } from "nativemp";
const delivery = await checkpoints.create({ position: [2495, -1680, 13.3], size: 4 });
server.on("playerEnteredCheckpoint", async ({ player, checkpoint }) => { if (delivery.status === "applied" && checkpoint.id === delivery.createdId) await players.giveMoney(player, 500);});Related
Section titled “Related”playerLeftCheckpoint: they went outPlayerCheckpointPayload- World markers: when the events come