Skip to content

bans.remove

Removes a ban, so the address can connect again.

bans.remove(id: string): Promise<ActionResult>
Name Type Description
id string The ban’s ID, from bans.list().

A promise of an ActionResult: applied once the change is saved. An empty or too long ID is invalid-ban-id, an ID that is not banned ban-not-found, and a bans file that could not be written ban-save-failed.

gamemodes/admin.ts
import { bans, chat, commands } from "nativemp";
commands.register("unban", async (player, args) => {
const result = await bans.remove(args.trim());
chat.sendServerMessage(result.status === "applied" ? "Unbanned." : "No such ban.", player);
});