addWeaponItem: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) 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"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...) |
Lou Montana (talk | contribs) m (Fix parameter) |
||
(34 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{RV|type=command | ||
| arma3 | |game1= arma3 | ||
|version1= 1.38 | |||
|1.38 | |||
|arg= local | |arg= local | ||
Line 11: | Line 10: | ||
|gr1= Unit Inventory | |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. | |descr= 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. | ||
| unit | |s1= unit [[addWeaponItem]] [weaponName, itemName, instant] | ||
|p1= unit: [[Object]] | |p1= unit: [[Object]] | ||
| [[Nothing]] | |p2= weaponName: [[String]] - name of the weapon to add magazine to | ||
|p3= itemName: [[String]] - class name of the item to add (if magazine, muzzle will be autodetected) | |||
|p4= instant: [[Boolean]] - (Optional, default [[false]]) [[true]] to skip animation | |||
|p4since= arma3 1.96 | |||
|r1= [[Nothing]] | |||
| s2= unit | |s2= unit [[addWeaponItem]] [weaponName, [itemName, ammoCount, muzzleName], instant] | ||
|p21= unit: [[Object]] | |p21= unit: [[Object]] | ||
| | |p22= weaponName: [[String]] - name of the weapon to add magazine to | ||
|p23= itemName: [[String]] - class name of the item to add (if magazine, muzzle will be autodetected unless specified) | |||
|p24= ammoCount: [[Number]] - (Optional) optional amount of ammo in magazine | |||
| | |p25= muzzleName: [[String]] - (Optional) optional target muzzle to add magazine to | ||
| [[ | |p26= instant: [[Boolean]] - (Optional, default [[false]]) [[true]] to skip animation | ||
|p26since= arma3 1.96 | |||
|r2= [[Nothing]] | |||
|x1= <sqf>player addWeaponItem ["arifle_MX_GL_ACO_F", "1Rnd_HE_Grenade_shell"];</sqf> | |||
< | |x2= <sqf>player addWeaponItem ["arifle_MX_GL_ACO_F", ["1Rnd_HE_Grenade_shell", 1, "GL_3GL_F"]];</sqf> | ||
</ | |||
< | |x3= <sqf>player addWeaponItem ["LaserDesignator", "LaserBatteries"];</sqf> | ||
|seealso= [[addPrimaryWeaponItem]] [[addSecondaryWeaponItem]] [[addHandgunItem]] [[addBinocularItem]] [[weaponsItems]] [[handgunItems]] [[primaryWeaponItems]] [[secondaryWeaponItems]] [[binocularItems]] [[removePrimaryWeaponItem]] [[removeSecondaryWeaponItem]] [[removeHandgunItem]] [[removeBinocularItem]] | |||
}} | |||
[[ |
Latest revision as of 15:44, 16 June 2023
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.
- Groups:
- Unit Inventory
Syntax
- Syntax:
- unit addWeaponItem [weaponName, itemName, instant]
- Parameters:
- unit: Object
- 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)
- since 1.96
- instant: Boolean - (Optional, default false) true to skip animation
- Return Value:
- Nothing
Alternative Syntax
- Syntax:
- unit addWeaponItem [weaponName, [itemName, ammoCount, muzzleName], instant]
- Parameters:
- unit: Object
- 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 unless specified)
- ammoCount: Number - (Optional) optional amount of ammo in magazine
- muzzleName: String - (Optional) optional target muzzle to add magazine to
- since 1.96
- instant: Boolean - (Optional, default false) true to skip animation
- Return Value:
- Nothing
Examples
- Example 1:
- Example 2:
- Example 3:
Additional Information
- See also:
- addPrimaryWeaponItem addSecondaryWeaponItem addHandgunItem addBinocularItem weaponsItems handgunItems primaryWeaponItems secondaryWeaponItems binocularItems removePrimaryWeaponItem removeSecondaryWeaponItem removeHandgunItem removeBinocularItem
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