checkpoints.getById
Returns one of your checkpoints by its ID, or undefined when there is none.
Renamed in 0.28 from checkpoints.get; see renamed names.
Signature
Section titled “Signature”checkpoints.getById(id: number): Checkpoint | undefinedParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
id |
number |
The ID from checkpoints.create. |
Returns
Section titled “Returns”The Checkpoint, or undefined for an ID that is not one of your checkpoints.
Example
Section titled “Example”import { checkpoints, server } from "nativemp";
const markerId = 0; // the ID checkpoints.create returnedconst marker = checkpoints.getById(markerId);if (marker) server.log(`It is in virtual world ${marker.virtualWorld}`);Related
Section titled “Related”checkpoints.create: make onecheckpoints.update: change itcheckpoints.destroy: remove itcheckpoints.listAll: all of them