removeWeapon: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|= Game name" to "|Game name=")
m (Text replacement - ">Posted on May ([0-9]{2}), ([0-9]{4})" to ">Posted on $2-05-$1")
 
(43 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| ofp |Game name=
|game1= ofp
|version1= 1.00


|1.00|Game version=
|game2= ofpe
|version2= 1.00


|eff= global|Multiplayer Effects=
|game3= arma1
|version3= 1.00


|arg= local|Multiplayer Arguments=
|game4= arma2
|version4= 1.00


____________________________________________________________________________________________
|game5= arma2oa
|version5= 1.50


| 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]].
|game6= tkoh
|version6= 1.00


'''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. |DESCRIPTION=
|game7= arma3
____________________________________________________________________________________________
|version7= 0.50


| unit '''removeWeapon''' weapon |SYNTAX=
|eff= global


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


| [[Nothing]] |RETURNVALUE=
|gr1= Unit Inventory
____________________________________________________________________________________________
 
|x1= <code>[[player]] [[removeWeapon]] "BAF_L85A2_RIS_SUSAT";</code> |EXAMPLE1=


|x2= <code>An_2 [[removeWeapon]] "M240_veh";</code> |EXAMPLE2=
|gr2= Vehicle Inventory
____________________________________________________________________________________________


| [[removeWeaponGlobal]], [[addWeapon]], [[removeAllWeapons]] |SEEALSO=
|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.
|s1= unit [[removeWeapon]] weapon
|p1= unit: [[Object]] - unit or vehicle
|p2= weapon: [[String]] - weapon class name
|r1= [[Nothing]]
|x1= <sqf>player removeWeapon "BAF_L85A2_RIS_SUSAT";</sqf>
|x2= <sqf>An_2 removeWeapon "M240_veh";</sqf>
|seealso= [[removeWeaponGlobal]] [[addWeapon]] [[removeAllWeapons]]
}}
}}


<h3 style="display:none">Notes</h3>
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->


<dd class="notedate">Posted on May 27, 2009 - 14:30 (CEST)
<dt><dt>
<dt class="note">[[User:ZGuba|zGuba]]
<dd class="notedate">Posted on 2009-05-27 - 14:30 (CEST)</dd>
<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.
<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.


<!-- Note Section END -->
</dl>
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands|REMOVEWEAPON]]
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.96|REMOVEWEAPON]]
[[Category:Scripting Commands OFP 1.46|REMOVEWEAPON]]
[[Category:Scripting Commands ArmA|REMOVEWEAPON]]
[[Category:Command_Group:_Unit_Control|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_Weapons|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]

Latest revision as of 23:00, 13 May 2023

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

Syntax

Syntax:
unit removeWeapon weapon
Parameters:
unit: Object - unit or vehicle
weapon: String - weapon class name
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
Posted on 2009-05-27 - 14:30 (CEST)
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.