addWeaponWithAttachmentsCargoGlobal: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Arma[ _]3(\|.*)]]" to "{{GameCategory|arma3|Scripting Commands}}")
m (Text replacement - "_{10,} " to "")
Line 1: Line 1:
{{Command|Comments=
{{Command|Comments=
____________________________________________________________________________________________


| arma3 |Game=
| arma3 |Game=
Line 11: Line 10:


|gr1= Vehicle Inventory |GROUP1=
|gr1= Vehicle Inventory |GROUP1=
____________________________________________________________________________________________


| Adds a weapon into cargo space of a vehicle / box with given attachments / magazines. Ignores available cargo space. If the weapon class has any pre-attached items (LinkedItems), they are removed and new items, supplied via command arguments, are added. This command has a global effect. |Description=
| Adds a weapon into cargo space of a vehicle / box with given attachments / magazines. Ignores available cargo space. If the weapon class has any pre-attached items (LinkedItems), they are removed and new items, supplied via command arguments, are added. This command has a global effect. |Description=
____________________________________________________________________________________________


| container [[addWeaponWithAttachmentsCargoGlobal]] [<nowiki/>[weapon, muzzle, flashlight, optics, [primaryMuzzleMagazine, ammoCount], [secondaryMuzzleMagazine, ammoCount], bipod], weaponsCount] |SYNTAX=
| container [[addWeaponWithAttachmentsCargoGlobal]] [<nowiki/>[weapon, muzzle, flashlight, optics, [primaryMuzzleMagazine, ammoCount], [secondaryMuzzleMagazine, ammoCount], bipod], weaponsCount] |SYNTAX=
Line 36: Line 33:
| [[Nothing]] |Return Value=
| [[Nothing]] |Return Value=


____________________________________________________________________________________________


|x1= <code>[[cursorObject]] [[addWeaponWithAttachmentsCargoGlobal]] [<nowiki/>["arifle_MX_GL_F", "muzzle_snds_H", "", "optic_aco", ["30Rnd_65x39_caseless_mag", 15], ["3Rnd_HE_Grenade_shell", 2], ""], 2];
|x1= <code>[[cursorObject]] [[addWeaponWithAttachmentsCargoGlobal]] [<nowiki/>["arifle_MX_GL_F", "muzzle_snds_H", "", "optic_aco", ["30Rnd_65x39_caseless_mag", 15], ["3Rnd_HE_Grenade_shell", 2], ""], 2];
</code> |Example 1=
</code> |Example 1=
____________________________________________________________________________________________


|x2= Add five MX GL rifles with flashlight side attachment and a full 30 round magazine loaded into the gun, and full 3Rnd HE grenade magazine loaded into the grenade launcher: <code>[[cursorObject]] [[addWeaponWithAttachmentsCargoGlobal]] [<nowiki/>["arifle_MX_GL_F", "", "acc_flashlight", "", ["30Rnd_65x39_caseless_mag", 30], ["3Rnd_HE_Grenade_shell", 2], ""], 5]</code> |Example 2=
|x2= Add five MX GL rifles with flashlight side attachment and a full 30 round magazine loaded into the gun, and full 3Rnd HE grenade magazine loaded into the grenade launcher: <code>[[cursorObject]] [[addWeaponWithAttachmentsCargoGlobal]] [<nowiki/>["arifle_MX_GL_F", "", "acc_flashlight", "", ["30Rnd_65x39_caseless_mag", 30], ["3Rnd_HE_Grenade_shell", 2], ""], 5]</code> |Example 2=
____________________________________________________________________________________________


|x3= Add one MX rifle without any attachments or magazines event though the class has linked items: <code>[[cursorObject]] [[addWeaponWithAttachmentsCargoGlobal]] [<nowiki/>["arifle_MX_Holo_pointer_F", "", "", "", [], [], ""], 1];</code> |Example 3=
|x3= Add one MX rifle without any attachments or magazines event though the class has linked items: <code>[[cursorObject]] [[addWeaponWithAttachmentsCargoGlobal]] [<nowiki/>["arifle_MX_Holo_pointer_F", "", "", "", [], [], ""], 1];</code> |Example 3=
____________________________________________________________________________________________


|x4= Add all weapons on player with attachments: <code>{ [[cursorObject]] [[addWeaponWithAttachmentsCargoGlobal]] [_x, 1] } [[forEach]] [[weaponsItems]] [[player]];</code> |Example 4=
|x4= Add all weapons on player with attachments: <code>{ [[cursorObject]] [[addWeaponWithAttachmentsCargoGlobal]] [_x, 1] } [[forEach]] [[weaponsItems]] [[player]];</code> |Example 4=

Revision as of 01:02, 17 January 2021

Hover & click on the images for description

Description

Description:
Adds a weapon into cargo space of a vehicle / box with given attachments / magazines. Ignores available cargo space. If the weapon class has any pre-attached items (LinkedItems), they are removed and new items, supplied via command arguments, are added. This command has a global effect.
Groups:
Vehicle Inventory

Syntax

Syntax:
container addWeaponWithAttachmentsCargoGlobal [[weapon, muzzle, flashlight, optics, [primaryMuzzleMagazine, ammoCount], [secondaryMuzzleMagazine, ammoCount], bipod], weaponsCount]
Parameters:
container: Object - Container to add the weapon to, might be backpack, ammobox or vehicle
[[weapon, muzzle, flashlight, optics, [primaryMuzzleMagazine, ammoCount], [secondaryMuzzleMagazine, ammoCount], bipod], weaponsCount]: Array
[weapon, muzzle, flashlight, optics, [primaryMuzzleMagazine, ammoCount], [secondaryMuzzleMagazine, ammoCount], bipod]: Array in format weaponsItems
weapon: String - Weapon class name. See the topic Category:Weapons for reference about possible values
muzzle: String - Muzzle attachment class name or "" if not needed
flashlight: String - Side rail attachment class name or "" if not needed
optics: String - Top rail attachment class name or "" if not needed
[primaryMuzzleMagazine, ammoCount]: Array - Primary muzzle magazine info or [] if not needed
primaryMuzzleMagazine: String - Magazine class name
ammoCount: Number - Ammo count in magazine (will be clipped in 0 and max mag capacity range)
[secondaryMuzzleMagazine, ammoCount]: Array - Secondary muzzle magazine info or [] if not needed
secondaryMuzzleMagazine: String - Magazine class name
ammoCount: Number - Ammo count in magazine (will be clipped in 0 and max mag capacity range)
bipod: String - Underbarrel rail attachment class name or "" if not needed
weaponsCount: Number - Number of weapons to add
Return Value:
Nothing

Examples

Example 1:
cursorObject addWeaponWithAttachmentsCargoGlobal [["arifle_MX_GL_F", "muzzle_snds_H", "", "optic_aco", ["30Rnd_65x39_caseless_mag", 15], ["3Rnd_HE_Grenade_shell", 2], ""], 2];
Example 2:
Add five MX GL rifles with flashlight side attachment and a full 30 round magazine loaded into the gun, and full 3Rnd HE grenade magazine loaded into the grenade launcher: cursorObject addWeaponWithAttachmentsCargoGlobal [["arifle_MX_GL_F", "", "acc_flashlight", "", ["30Rnd_65x39_caseless_mag", 30], ["3Rnd_HE_Grenade_shell", 2], ""], 5]
Example 3:
Add one MX rifle without any attachments or magazines event though the class has linked items: cursorObject addWeaponWithAttachmentsCargoGlobal [["arifle_MX_Holo_pointer_F", "", "", "", [], [], ""], 1];
Example 4:
Add all weapons on player with attachments: { cursorObject addWeaponWithAttachmentsCargoGlobal [_x, 1] } forEach weaponsItems player;

Additional Information

See also:
addWeaponWithAttachmentsCargoaddWeaponCargoaddWeaponCargoGlobalclearWeaponCargogetWeaponCargo

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
Posted on October 28, 2020 - 20:57 (UTC)
Andrew_S90
This command also allows you to add a weapon with attachments directly to the players backpack. (backpackContainer player) addWeaponWithAttachmentsCargoGlobal [ ["arifle_MX_F","muzzle_snds_H","acc_pointer_IR","optic_Hamr",["30Rnd_65x39_caseless_mag",30],[],"bipod_03_F_blk"], 1];