Arma 3 Scripting

Command in Unit Inventory, Vehicle Inventory

removeWeapon

Also available as Markdown and JSON, or read the original wiki page.

Description

Remove weapon from a unit. The unit must be local to the computer where command is executed. For a global version of this command, see removeWeaponGlobal.

Note

It is possible to create invalid combinations with this command (e.g attempting to remove a weapon that a unit does not possess). When doing so, application behaviour is undefined.

Syntax

Syntax 1

unit removeWeapon weapon

Parameters:

Returns: Nothing

Syntax 2

since arma3 2.20

object removeWeapon [weapon, autoselect]

Parameters:

Returns: Nothing

Examples

Example 1

player removeWeapon "BAF_L85A2_RIS_SUSAT";

Example 2

An_2 removeWeapon "M240_veh";

See also

removeWeaponGlobal · addWeapon · removeAllWeapons

Community notes

zGuba

CTD may occur in certain conditions: when shooter is AI and is currently shooting at target in some proximity (tested with M136 on ACE 1.08 and Compact Fix 1.14H+). Even "dropweapon" action may cause CTD with AI.