addPrimaryWeaponItem: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - ">Posted on June ([0-9]{2})[ a-zA-Z]*, ([0-9]{4})" to ">Posted on $2-06-$1")
(39 intermediate revisions by 3 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 |MPARGUMENTS=
|gr1= Unit Inventory
|eff= global |MPeff=


|gr1= Unit Inventory |GROUP1=
|descr= Adds weapon item, including magazine, directly to the [[primaryWeapon]]. This is used for infantry weapons.
____________________________________________________________________________________________


| Adds weapon item, including magazine, directly to the [[primaryWeapon]]. This is used for infantry weapons.|DESCRIPTION=
|s1= unit [[addPrimaryWeaponItem]] item
____________________________________________________________________________________________


| unit '''addPrimaryWeaponItem''' item |SYNTAX=
|p1= unit: [[Object]]


|p1= unit: [[Object]] |PARAMETER1=
|p2= item: [[String]]


|p2= item: [[String]] |PARAMETER2=
|r1= [[Nothing]] or [[Boolean]] - '''false''' is returned if '''item''' can not be added


| [[Nothing]] |RETURNVALUE=  
|x1= <sqf>player addPrimaryWeaponItem "muzzle_snds_H";</sqf>


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


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


<h3 style='display:none'>Bottom Section</h3>
<dt></dt>
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
<dd class="notedate">Posted on 2014-06-22 - 23:08 (UTC)</dd>
[[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>
<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 -->

Revision as of 00:08, 14 May 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.