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