removeWeapon: Difference between revisions
Lou Montana (talk | contribs) m (Text replacement - " \| *(game[0-9]|version[0-9]|gr[0-9]|serverExec|mp|pr|descr|s[0-9]|p[0-9]{1,3}|r[0-9]|x1?[0-9]|seealso) *= +" to " |$1= ") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(11 intermediate revisions by 3 users not shown) | |||
Line 30: | Line 30: | ||
|gr2= Vehicle Inventory | |gr2= Vehicle Inventory | ||
|descr= 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]]. | |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]]. | |||
{{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 | |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 | ||
|r1=[[Nothing]] | |r1= [[Nothing]] | ||
|s2= object [[removeWeapon]] [weapon, autoselect] | |||
|s2since= arma3 2.20 | |||
|p21= object: [[Object]] - unit or vehicle | |||
|p22= weapon: [[String]] - weapon class name | |||
| | |p23= autoselect: [[String]] - (Optional, default [[true]]) [[false]] to abort weapon autoselection when removing primary weapon. | ||
| | |r2= [[Nothing]] | ||
| | |x1= <sqf>player removeWeapon "BAF_L85A2_RIS_SUSAT";</sqf> | ||
< | |x2= <sqf>An_2 removeWeapon "M240_veh";</sqf> | ||
|seealso= [[removeWeaponGlobal]] [[addWeapon]] [[removeAllWeapons]] | |||
}} | |||
{{Note | |||
|user= zGuba | |||
|timestamp= 20090527143000 | |||
|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. | |||
}} |
Latest revision as of 00:27, 15 October 2025
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.
- 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:
- 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
- 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.
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.00
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- Operation Flashpoint: Elite: Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Unit Inventory
- Command Group: Vehicle Inventory
- Scripting Commands: Global Effect