addWeaponWithAttachmentsCargo
Jump to navigation
Jump to search
Description
- Description:
- Add a weapon into cargo space of vehicles, but with pre-attached attachments/magazines. Ignores available cargo space.
This clears all pre-attached items if the weapon class has LinkedItems.
- Groups:
- Uncategorised
Syntax
- Syntax:
- container addWeaponWithAttachmentsCargo [weapon, muzzleAttachment, sideAttachment, topAttachment, bipodAttachment, [(primaryMagazine), (primaryAmmoCount), (secondaryMagazine), (secondaryAmmoCount)], (count)]
- Parameters:
- container: Object - Container to add the weapon to, might be backpack, ammobox or vehicle.
- weapon: String - Weapon classname. See the topic Category:Weapons for reference about possible values.
- muzzleAttachment: String - Muzzle attachment classname. If you don't want any just supply empty string.
- sideAttachment: String - Side rail attachment classname. If you don't want any just supply empty string.
- topAttachment: String - Top rail attachment classname. If you don't want any just supply empty string.
- bipodAttachment: String - Underbarrel rail attachment classname. If you don't want any just supply empty string.
- primaryMagazine (Optional): String - Primary magazine classname. If you don't want any just supply empty string or leave the whole magazine array empty.
- primaryAmmoCount (Optional): Number - Ammo count in primary magazine. If you want a full magazine you can use -1.
- secondaryMagazine (Optional): String - Secondary magazine classname. If you don't want any just supply empty string or leave the whole magazine array empty.
- secondaryAmmoCount (Optional): Number - Ammo count in secondary magazine. If you want a full magazine you can use -1.
- count (Optional): Number - Number of weapons to add. Default is 1.
- Return Value:
- Nothing
Examples
- Example 1:
cursorTarget addWeaponWithAttachmentsCargo ["arifle_MX_GL_F", "muzzle_snds_H", "acc_flashlight", "optic_aco", "", ["30Rnd_65x39_caseless_mag", 15, "3Rnd_HE_Grenade_shell", 2], 2]
- Example 2:
cursorTarget addWeaponWithAttachmentsCargo ["arifle_MX_GL_F", "", "acc_flashlight", "", "", ["30Rnd_65x39_caseless_mag", 30, "3Rnd_HE_Grenade_shell"], 2]
Add's two MX GL rifles with flashlight side attachment and a full 30 round magazine loaded into the gun, and 3Rnd HE grenade magazine loaded into the grenade launcher- Example 3:
cursorTarget addWeaponWithAttachmentsCargo ["arifle_MX_GL_F", "", "", "", "", []]
Same as a simple addWeaponCargo. This is the minimum number of arguments you need to supply.
Additional Information
- See also:
- addWeaponWithAttachmentsCargoGlobaladdWeaponCargoaddWeaponCargoGlobalclearWeaponCargogetWeaponCargo,
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
[[Category:Introduced with arma3dev version 1.95]][[ Category: arma3dev: New Scripting Commands | ADDWEAPONWITHATTACHMENTSCARGO]][[ Category: arma3dev: Scripting Commands | ADDWEAPONWITHATTACHMENTSCARGO]]