addPrimaryWeaponItem: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(support for magazines)
m (Undo revision 347499 by Hypoxic125 (talk))
Tag: Undo
 
(56 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma3 |= Game name
|game1= arma3
|version1= 0.50


|0.50|= Game version
|arg= local
|eff= global


|arg= local |=
|gr1= Unit Inventory
|eff= global |=
____________________________________________________________________________________________


| Adds weapon item to the weapon cargo space. This is used for infantry weapons.<br>
|descr= Adds weapon item, including magazine, directly to the [[primaryWeapon]]. This is used for infantry weapons.
As of Arma 3 DEV 1.37, this command also supports weapon magazines. |= Description
____________________________________________________________________________________________


| unit '''addPrimaryWeaponItem''' item |= Syntax
|s1= unit [[addPrimaryWeaponItem]] item


|p1= unit: [[Object]] |= PARAMETER1
|p1= unit: [[Object]]


|p2= item: [[String]] |= PARAMETER2
|p2= item: [[String]]


| [[Nothing]] |= RETURNVALUE
|r1= [[Nothing]] or [[Boolean]] - '''false''' is returned if '''item''' can not be added


|x1= <sqf>player addPrimaryWeaponItem "muzzle_snds_H";</sqf>


|x1= <code>player [[addPrimaryWeaponItem]] "muzzle_snds_H";
|seealso= [[addWeaponItem]] [[removePrimaryWeaponItem]] [[removeAllPrimaryWeaponItems]] [[addSecondaryWeaponItem]] [[addHandgunItem]] [[addBinocularItem]] [[weaponsItems]] [[handgunItems]] [[primaryWeaponItems]] [[secondaryWeaponItems]] [[binocularItems]]
</code>|= EXAMPLE1
 
____________________________________________________________________________________________
 
| [[removePrimaryWeaponItem]], [[removeAllPrimaryWeaponItems]], [[addSecondaryWeaponItem]], [[addHandgunItem]], [[weaponsItems]], [[handgunItems]], [[primaryWeaponItems]], [[secondaryWeaponItems]]   |= SEEALSO
 
|  |= MPBEHAVIOUR
____________________________________________________________________________________________
}}
}}


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


<!-- Note Section END -->
<dt></dt>
</dl>
<dd class="notedate">Posted on 2014-06-22 - 23:08 (UTC)</dd>
 
<dt class="note">[[User:SilentSpike|SilentSpike]]</dt>
<h3 style='display:none'>Bottom Section</h3>
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_Weapons|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on June 22, 2014 - 23:08 (UTC)</dd>
<dt class="note">'''[[User:SilentSpike|SilentSpike]]'''</dt>
<dd class="note">
<dd class="note">
If the item being added is not supported by the unit's weapon then the command will simply fail silently. The item is also '''not''' added to the unit's inventory in such a case.
If the item being added is not supported by the unit's weapon then the command will simply fail silently. The item is also '''not''' added to the unit's inventory in such a case.
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 02:03, 24 September 2023

Hover & click on the images for description

Description

Description:
Adds weapon item, including magazine, directly to the primaryWeapon. This is used for infantry weapons.
Groups:
Unit Inventory

Syntax

Syntax:
unit addPrimaryWeaponItem item
Parameters:
unit: Object
item: String
Return Value:
Nothing or Boolean - false is returned if item can not be added

Examples

Example 1:
player addPrimaryWeaponItem "muzzle_snds_H";

Additional Information

See also:
addWeaponItem removePrimaryWeaponItem removeAllPrimaryWeaponItems addSecondaryWeaponItem addHandgunItem addBinocularItem weaponsItems handgunItems primaryWeaponItems secondaryWeaponItems binocularItems

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 2014-06-22 - 23:08 (UTC)
SilentSpike
If the item being added is not supported by the unit's weapon then the command will simply fail silently. The item is also not added to the unit's inventory in such a case.