Skip to content

fires.extinguish

Puts a fire out for every player. sharedFireStopped follows with reason "script". Players who join later do not see it.

fires.extinguish(id: string): Promise<ActionResult>
Name Type Description
id string The fire’s ID, from fires.listAll or an event.

A promise of an ActionResult: applied once the server put it out (the players’ games follow), rejected with a code, or timeout after five seconds without an answer.

Code Meaning
invalid-fire-id Not a fire ID: empty, zero, not a decimal number, or above 18446744073709551615.
fire-not-found No such fire, or it is already out.
gamemodes/my-mode.ts
import { chat, commands, fires } from "nativemp";
commands.register("extinguish", async (player, id) => {
const result = await fires.extinguish(id.trim());
chat.sendServerMessage(result.status === "rejected" ? result.code : result.status, player);
});