checkpoints.update
Changes the settings you give and keeps the rest. Players who see the checkpoint see the change at once. players: null
makes it everyone’s again.
Signature
Section titled “Signature”checkpoints.update(id: number, changes: Partial<CheckpointSettings>): Promise<ActionResult>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
id |
number |
The ID from checkpoints.create. |
changes |
Partial<CheckpointSettings> |
Any of its settings; see checkpoints.create. |
Returns
Section titled “Returns”A promise of an ActionResult: applied, or rejected with the codes of
checkpoints.create, or marker-not-found for an ID that is not one of your checkpoints. A rejected update changes nothing.
Example
Section titled “Example”import { checkpoints } from "nativemp";
for (const marker of checkpoints.listAll()) await checkpoints.update(marker.id, { visible: false });Related
Section titled “Related”checkpoints.create: make onecheckpoints.destroy: remove itcheckpoints.listAll: all of themscriptMarkerUpdated: it changed