Skip to content

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.

mapIcons.update(id: number, changes: Partial<MapIconSettings>): Promise<ActionResult>
Name Type Description
id number The ID from mapIcons.create.
changes Partial<MapIconSettings> Any of its settings; see mapIcons.create.

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.

gamemodes/my-mode.ts
import { mapIcons } from "nativemp";
for (const marker of mapIcons.listAll()) await mapIcons.update(marker.id, { icon: 19 });