addWeaponWithAttachmentsCargo

From Bohemia Interactive Community
Revision as of 23:14, 18 April 2019 by Dedmen (talk | contribs) (Fix template error)
Jump to navigation Jump to search
-wrong parameter ("arma3dev") defined!-[[:Category:Introduced with arma3dev version 1.93|1.93]]
Hover & click on the images for description

Description

Description:
Add a weapon into cargo space of vehicles, but with pre-attached attachments/magazines. Ignores available cargo space.

The cargo object this is applied on can be remote. But only local player will see the changed inventory.
You most likely want addWeaponWithAttachmentsCargoGlobal in any multiplayer scenario
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 default you can just omit this parameter.
But you have to supply a correct value if you want a secondary magazine. (Might change before release out of dev branch)
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 default you can just omit this parameter.
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.93]][[ Category: arma3dev: New Scripting Commands | ADDWEAPONWITHATTACHMENTSCARGO]][[ Category: arma3dev: Scripting Commands | ADDWEAPONWITHATTACHMENTSCARGO]]

Bottom Section