addWeaponItem: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "_{10,} " to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("serv...)
Line 1: Line 1:
{{Command|Comments=
{{Command


| arma3 |Game name=
| arma3


|1.38|Game version=
|1.38


|arg= local |Multiplayer Arguments=
|arg= local |Multiplayer Arguments=
Line 9: Line 9:
|eff= global |Multiplayer Effects=
|eff= global |Multiplayer Effects=


|gr1= Unit Inventory |GROUP1=
|gr1= Unit Inventory


| Adds a weapon item to the specified weapon. The item can be weapon magazine, in which case the amount of ammo and target muzzle could also be specified.
| Adds a weapon item to the specified weapon. The item can be weapon magazine, in which case the amount of ammo and target muzzle could also be specified.
* Since Arma 3 v1.95 it is possible to add item instantly skipping the animation by providing optional boolean|DESCRIPTION=
* Since Arma 3 v1.95 it is possible to add item instantly skipping the animation by providing optional boolean


| unit '''addWeaponItem''' [weaponName, itemName, instant]|SYNTAX1=
| unit '''addWeaponItem''' [weaponName, itemName, instant]


|p1= unit: [[Object]] |PARAMETER1=
|p1= unit: [[Object]]
|p2= [weaponName, itemName, instant]: [[Array]] |PARAMETER2=
|p2= [weaponName, itemName, instant]: [[Array]]
|p3= weaponName: [[String]] - name of the weapon to add magazine to |PARAMETER3=
|p3= weaponName: [[String]] - name of the weapon to add magazine to
|p4 = itemName: [[String]] - class name of the item to add (if magazine, muzzle will be autodetected)|PARAMETER4=
|p4 = itemName: [[String]] - class name of the item to add (if magazine, muzzle will be autodetected)
|p5 = instant (Optional): [[Boolean]] - [[true]] to skip animation. Default: [[false]] |PARAMETER5=
|p5 = instant (Optional): [[Boolean]] - [[true]] to skip animation. Default: [[false]]


| [[Nothing]] |RETURNVALUE1=
| [[Nothing]]


| s2= unit '''addWeaponItem''' [weaponName, [itemName, ammoCount, muzzleName], instant]|SYNTAX2=
| s2= unit '''addWeaponItem''' [weaponName, [itemName, ammoCount, muzzleName], instant]


|p21= unit: [[Object]] |PARAMETER21=
|p21= unit: [[Object]] |PARAMETER21=
Line 35: Line 35:
|p28 = instant (Optional): [[Boolean]] - [[true]] to skip animation. Default: [[false]] |PARAMETER28=
|p28 = instant (Optional): [[Boolean]] - [[true]] to skip animation. Default: [[false]] |PARAMETER28=


|r2= [[Nothing]] |RETURNVALUE2=
|r2= [[Nothing]]


|x1= <code>[[player]] [[addWeaponItem]] ["arifle_MX_GL_ACO_F", "1Rnd_HE_Grenade_shell"];</code> |EXAMPLE1=
|x1= <code>[[player]] [[addWeaponItem]] ["arifle_MX_GL_ACO_F", "1Rnd_HE_Grenade_shell"];</code>
|x2= <code>[[player]] [[addWeaponItem]] ["arifle_MX_GL_ACO_F", ["1Rnd_HE_Grenade_shell", 1, "GL_3GL_F"]];</code> |EXAMPLE2=
|x2= <code>[[player]] [[addWeaponItem]] ["arifle_MX_GL_ACO_F", ["1Rnd_HE_Grenade_shell", 1, "GL_3GL_F"]];</code>
|x3= <code>[[player]] [[addWeaponItem]] ["Laserdesignator", "Laserbatteries"];</code> |EXAMPLE3=
|x3= <code>[[player]] [[addWeaponItem]] ["Laserdesignator", "Laserbatteries"];</code>


| [[addPrimaryWeaponItem]], [[addSecondaryWeaponItem]], [[addHandgunItem]], [[addBinocularItem]], [[weaponsItems]], [[handgunItems]], [[primaryWeaponItems]], [[secondaryWeaponItems]], [[binocularItems]], [[removePrimaryWeaponItem]], [[removeSecondaryWeaponItem]], [[removeHandgunItem]], [[removeBinocularItem]] |SEEALSO=
| [[addPrimaryWeaponItem]], [[addSecondaryWeaponItem]], [[addHandgunItem]], [[addBinocularItem]], [[weaponsItems]], [[handgunItems]], [[primaryWeaponItems]], [[secondaryWeaponItems]], [[binocularItems]], [[removePrimaryWeaponItem]], [[removeSecondaryWeaponItem]], [[removeHandgunItem]], [[removeBinocularItem]]


}}
}}

Revision as of 00:01, 18 January 2021

Hover & click on the images for description

Description

Description:
Adds a weapon item to the specified weapon. The item can be weapon magazine, in which case the amount of ammo and target muzzle could also be specified.
  • Since Arma 3 v1.95 it is possible to add item instantly skipping the animation by providing optional boolean
Groups:
Unit Inventory

Syntax

Syntax:
unit addWeaponItem [weaponName, itemName, instant]
Parameters:
unit: Object
[weaponName, itemName, instant]: Array
weaponName: String - name of the weapon to add magazine to
itemName: String - class name of the item to add (if magazine, muzzle will be autodetected)
instant (Optional): Boolean - true to skip animation. Default: false
Return Value:
Nothing

Alternative Syntax

Syntax:
unit addWeaponItem [weaponName, [itemName, ammoCount, muzzleName], instant]
Parameters:
unit: Object
[weaponName, [magazineName, ammoCount, muzzleName], instant]: Array
weaponName: String - name of the weapon to add magazine to
[itemName, ammoCount, muzzleName]: Array
itemName: String - class name of the item to add (if magazine, muzzle will be autodetected unless specified)
ammoCount (Optional): Number - optional amount of ammo in magazine
muzzleName (Optional): String - optional target muzzle to add magazine to
instant (Optional): Boolean - true to skip animation. Default: false
Return Value:
Nothing

Examples

Example 1:
player addWeaponItem ["arifle_MX_GL_ACO_F", "1Rnd_HE_Grenade_shell"];
Example 2:
player addWeaponItem ["arifle_MX_GL_ACO_F", ["1Rnd_HE_Grenade_shell", 1, "GL_3GL_F"]];
Example 3:
player addWeaponItem ["Laserdesignator", "Laserbatteries"];

Additional Information

See also:
addPrimaryWeaponItemaddSecondaryWeaponItemaddHandgunItemaddBinocularItemweaponsItemshandgunItemsprimaryWeaponItemssecondaryWeaponItemsbinocularItemsremovePrimaryWeaponItemremoveSecondaryWeaponItemremoveHandgunItemremoveBinocularItem

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

Notes

Bottom Section