players.removeAllWeapons
Removes all of a player’s weapons and ammunition.
Renamed in 0.28 from players.resetWeapons; see renamed names.
Signature
Section titled “Signature”players.removeAllWeapons(player: PlayerTarget): Promise<ActionResult>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
player |
PlayerTarget |
The player, or their ID. |
Returns
Section titled “Returns”A promise of an ActionResult: applied once the player’s game has carried it out, rejected with a code, or timeout after five seconds without an answer.
Example
Section titled “Example”Disarm a player with a command.
import { commands, players } from "nativemp";
commands.register("peace", async (player) => { await players.removeAllWeapons(player);});Related
Section titled “Related”players.giveWeapon: give one back
A captured Player keeps this effect bound to its connection across awaits; see Async handlers.