addWeaponItem: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\| *arma3 * * *\| *([0-2]\.[0-9]{2}) * " to "|game1= arma3 |version1= $1 ") |
Lou Montana (talk | contribs) m (Text replacement - "\|s1= +" to "|s1= ") |
||
Line 13: | Line 13: | ||
* Since Arma 3 v1.95 it is possible to add item instantly skipping the animation by providing optional boolean | * Since Arma 3 v1.95 it is possible to add item instantly skipping the animation by providing optional boolean | ||
|s1= | |s1= unit '''addWeaponItem''' [weaponName, itemName, instant] | ||
|p1= unit: [[Object]] | |p1= unit: [[Object]] |
Revision as of 15:29, 19 June 2021
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