removeWeapon: Difference between revisions

From Bohemia Interactive Community
No edit summary
m (Some wiki formatting)
 
(One intermediate revision by one other user not shown)
Line 30: Line 30:
|gr2= Vehicle Inventory
|gr2= Vehicle Inventory


|descr= Remove weapon from a unit. The unit must be [[Multiplayer Scripting#Locality|local]] to the computer where command is executed. For a global version of this command see [[removeWeaponGlobal]].
|descr= Remove weapon from a unit. The unit must be [[Multiplayer Scripting#Locality|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 (ie, attempting to remove a weapon that a unit does not possess). When doing so, application behaviour is undefined.
{{Feature|informative|
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.
}}


|s1= unit [[removeWeapon]] weapon
|s1= unit [[removeWeapon]] weapon


|p1= unit: [[Object]] - unit or vehicle
|p1= unit: [[Object]] - unit or vehicle
|p2= weapon: [[String]] - weapon class name
|p2= weapon: [[String]] - weapon class name


Line 43: Line 48:
|s2= object [[removeWeapon]] [weapon, autoselect]
|s2= object [[removeWeapon]] [weapon, autoselect]
|s2since= arma3 2.20
|s2since= arma3 2.20
|p21= object: [[Object]] - unit or vehicle
|p21= object: [[Object]] - unit or vehicle


|p22= weapon: [[String]] - weapon class name
|p22= weapon: [[String]] - weapon class name
|p23= autoselect (Optional): [[String]] - [[false]] to abort weapon autoselection when removing primary weapon. Default: [[true]]
 
|p23= autoselect: [[String]] - (Optional, default [[true]]) [[false]] to abort weapon autoselection when removing primary weapon.


|r2= [[Nothing]]
|r2= [[Nothing]]
Line 57: Line 64:
}}
}}


<dl class="command_description">
{{Note
 
|user= zGuba
<dt><dt>
|timestamp= 20090527143000
<dd class="notedate">Posted on 2009-05-27 - 14:30 (CEST)</dd>
|text= 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.
<dt class="note">[[User:ZGuba|zGuba]]</dt>
}}
<dd class="note">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.
 
</dl>

Latest revision as of 00:27, 15 October 2025

Hover & click on the images for description

Description

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.
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.
Groups:
Unit InventoryVehicle Inventory

Syntax

Syntax:
unit removeWeapon weapon
Parameters:
unit: Object - unit or vehicle
weapon: String - weapon class name
Return Value:
Nothing

Alternative Syntax

Syntax:
object removeWeapon [weapon, autoselect]
Parameters:
object: Object - unit or vehicle
weapon: String - weapon class name
autoselect: String - (Optional, default true) false to abort weapon autoselection when removing primary weapon.
Return Value:
Nothing

Examples

Example 1:
player removeWeapon "BAF_L85A2_RIS_SUSAT";
Example 2:
An_2 removeWeapon "M240_veh";

Additional Information

See also:
removeWeaponGlobal addWeapon removeAllWeapons

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
zGuba - c
Posted on May 27, 2009 - 14:30 (UTC)
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.