addWeaponItem: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (template:command argument fix)
(optional param)
Line 11: Line 11:
____________________________________________________________________________________________
____________________________________________________________________________________________


| 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. |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|DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


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


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


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


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


|p21= unit: [[Object]] |PARAMETER1=
|p21= unit: [[Object]] |PARAMETER21=
|p22= [weaponName, [magazineName, ammoCount, muzzleName]]: [[Array]] |PARAMETER2=
|p22= [weaponName, [magazineName, ammoCount, muzzleName], instant]: [[Array]] |PARAMETER22=
|p23= weaponName: [[String]] - name of the weapon to add magazine to |PARAMETER3=
|p23= weaponName: [[String]] - name of the weapon to add magazine to |PARAMETER23=
|p24= [itemName, ammoCount, muzzleName]: [[Array]] |=
|p24= [itemName, ammoCount, muzzleName]: [[Array]] |PARAMETER24=
|p25 = itemName: [[String]] - class name of the item to add (if magazine, muzzle will be autodetected unless specified)|=
|p25 = itemName: [[String]] - class name of the item to add (if magazine, muzzle will be autodetected unless specified)|PARAMETER25=
|p26 = ammoCount (Optional): [[Number]] - optional amount of ammo in magazine|=
|p26 = ammoCount (Optional): [[Number]] - optional amount of ammo in magazine|PARAMETER26=
|p27 = muzzleName (Optional): [[String]] - optional target muzzle to add magazine to |=
|p27 = muzzleName (Optional): [[String]] - optional target muzzle to add magazine to |PARAMETER27=
|p28 = instant (Optional): [[Boolean]] - [[true]] to skip animation. Default: [[false]] |PARAMETER28=


|r2= [[Nothing]] |RETURNVALUE=
|r2= [[Nothing]] |RETURNVALUE2=
____________________________________________________________________________________________
____________________________________________________________________________________________



Revision as of 21:20, 2 July 2019

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:
Uncategorised

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"]];

Additional Information

See also:
addPrimaryWeaponItemaddSecondaryWeaponItemaddHandgunItemweaponsItemshandgunItemsprimaryWeaponItemssecondaryWeaponItemsremovePrimaryWeaponItemremoveSecondaryWeaponItemremoveHandgunItem

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