addWeaponWithAttachmentsCargo: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
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"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("serv...) |
||
Line 1: | Line 1: | ||
{{Command | {{Command | ||
| arma3 | | arma3 | ||
|1.94 | |1.94 | ||
|arg= global |Arguments in MP= | |arg= global |Arguments in MP= | ||
Line 9: | Line 9: | ||
|eff= local |Effects in MP= | |eff= local |Effects in MP= | ||
|gr1= Vehicle Inventory | |gr1= Vehicle Inventory | ||
| 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. | | 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. | ||
{{Important | This command has [[local]] effect; for a global variant, see [[addWeaponWithAttachmentsCargoGlobal]].}} | {{Important | This command has [[local]] effect; for a global variant, see [[addWeaponWithAttachmentsCargoGlobal]].}} | ||
| container [[addWeaponWithAttachmentsCargo]] [<nowiki/>[weapon, muzzle, flashlight, optics, [primaryMuzzleMagazine, ammoCount], [secondaryMuzzleMagazine, ammoCount], bipod], weaponsCount] | | container [[addWeaponWithAttachmentsCargo]] [<nowiki/>[weapon, muzzle, flashlight, optics, [primaryMuzzleMagazine, ammoCount], [secondaryMuzzleMagazine, ammoCount], bipod], weaponsCount] | ||
|p1= container: [[Object]] - Container to add the weapon to, might be backpack, ammobox or vehicle | |p1= container: [[Object]] - Container to add the weapon to, might be backpack, ammobox or vehicle | ||
|p2= [<nowiki/>[weapon, muzzle, flashlight, optics, [primaryMuzzleMagazine, ammoCount], [secondaryMuzzleMagazine, ammoCount], bipod], weaponsCount]: [[Array]] | |p2= [<nowiki/>[weapon, muzzle, flashlight, optics, [primaryMuzzleMagazine, ammoCount], [secondaryMuzzleMagazine, ammoCount], bipod], weaponsCount]: [[Array]] | ||
|p3= [weapon, muzzle, flashlight, optics, [primaryMuzzleMagazine, ammoCount], [secondaryMuzzleMagazine, ammoCount], bipod]: [[Array]] in format [[weaponsItems]] | |p3= [weapon, muzzle, flashlight, optics, [primaryMuzzleMagazine, ammoCount], [secondaryMuzzleMagazine, ammoCount], bipod]: [[Array]] in format [[weaponsItems]] | ||
|p4= weapon: [[String]] - Weapon class name. See the topic [[:Category:Weapons]] for reference about possible values | |p4= weapon: [[String]] - Weapon class name. See the topic [[:Category:Weapons]] for reference about possible values | ||
|p5= muzzle: [[String]] - Muzzle attachment class name or "" if not needed | |p5= muzzle: [[String]] - Muzzle attachment class name or "" if not needed | ||
|p6= flashlight: [[String]] - Side rail attachment class name or "" if not needed | |p6= flashlight: [[String]] - Side rail attachment class name or "" if not needed | ||
|p7= optics: [[String]] - Top rail attachment class name or "" if not needed | |p7= optics: [[String]] - Top rail attachment class name or "" if not needed | ||
|p8= [primaryMuzzleMagazine, ammoCount]: [[Array]] - Primary muzzle magazine info or [] if not needed | |p8= [primaryMuzzleMagazine, ammoCount]: [[Array]] - Primary muzzle magazine info or [] if not needed | ||
|p9= primaryMuzzleMagazine: [[String]] - Magazine class name | |p9= primaryMuzzleMagazine: [[String]] - Magazine class name | ||
|p10= ammoCount: [[Number]] - Ammo count in magazine (will be clipped in 0 and max mag capacity range) |Parameter 10= | |p10= ammoCount: [[Number]] - Ammo count in magazine (will be clipped in 0 and max mag capacity range) |Parameter 10= | ||
Line 46: | Line 46: | ||
|p15= weaponsCount: [[Number]] - Number of weapons to add |Parameter 15= | |p15= weaponsCount: [[Number]] - Number of weapons to add |Parameter 15= | ||
| [[Nothing]] | | [[Nothing]] | ||
|x1= <code>[[cursorObject]] [[addWeaponWithAttachmentsCargo]] [<nowiki/>["arifle_MX_GL_F", "muzzle_snds_H", "", "optic_aco", ["30Rnd_65x39_caseless_mag", 15], ["3Rnd_HE_Grenade_shell", 2], ""], 2]; | |x1= <code>[[cursorObject]] [[addWeaponWithAttachmentsCargo]] [<nowiki/>["arifle_MX_GL_F", "muzzle_snds_H", "", "optic_aco", ["30Rnd_65x39_caseless_mag", 15], ["3Rnd_HE_Grenade_shell", 2], ""], 2]; | ||
</code> | </code> | ||
|x2= Add five MX GL rifles with flashlight side attachment and a full 30 rounds magazine loaded into the gun, and full 3Rnd HE grenade magazine loaded into the grenade launcher: | |x2= Add five MX GL rifles with flashlight side attachment and a full 30 rounds magazine loaded into the gun, and full 3Rnd HE grenade magazine loaded into the grenade launcher: | ||
<code>[[cursorObject]] [[addWeaponWithAttachmentsCargo]] [<nowiki/>["arifle_MX_GL_F", "", "acc_flashlight", "", ["30Rnd_65x39_caseless_mag", 30], ["3Rnd_HE_Grenade_shell", 2], ""], 5]</code> | <code>[[cursorObject]] [[addWeaponWithAttachmentsCargo]] [<nowiki/>["arifle_MX_GL_F", "", "acc_flashlight", "", ["30Rnd_65x39_caseless_mag", 30], ["3Rnd_HE_Grenade_shell", 2], ""], 5]</code> | ||
|x3= Add one MX rifle without any attachments or magazines event though the class has linked items: | |x3= Add one MX rifle without any attachments or magazines event though the class has linked items: | ||
<code>[[cursorObject]] [[addWeaponWithAttachmentsCargo]] [<nowiki/>["arifle_MX_Holo_pointer_F", "", "", "", [], [], ""], 1];</code> | <code>[[cursorObject]] [[addWeaponWithAttachmentsCargo]] [<nowiki/>["arifle_MX_Holo_pointer_F", "", "", "", [], [], ""], 1];</code> | ||
|x4= Add all weapons on player with attachments: | |x4= Add all weapons on player with attachments: | ||
<code>{ [[cursorObject]] [[addWeaponWithAttachmentsCargo]] [_x, 1] } [[forEach]] [[weaponsItems]] [[player]];</code> | <code>{ [[cursorObject]] [[addWeaponWithAttachmentsCargo]] [_x, 1] } [[forEach]] [[weaponsItems]] [[player]];</code> | ||
| [[weaponsItems]], [[addWeaponCargo]], [[addWeaponCargoGlobal]], [[clearWeaponCargo]], [[getWeaponCargo]], [[addWeaponWithAttachmentsCargoGlobal]] | | [[weaponsItems]], [[addWeaponCargo]], [[addWeaponCargoGlobal]], [[clearWeaponCargo]], [[getWeaponCargo]], [[addWeaponWithAttachmentsCargoGlobal]] | ||
}} | }} | ||
Revision as of 00:01, 18 January 2021
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.
- Groups:
- Vehicle Inventory
Syntax
- Syntax:
- container addWeaponWithAttachmentsCargo [[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 addWeaponWithAttachmentsCargo [["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 rounds magazine loaded into the gun, and full 3Rnd HE grenade magazine loaded into the grenade launcher:
cursorObject addWeaponWithAttachmentsCargo [["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 addWeaponWithAttachmentsCargo [["arifle_MX_Holo_pointer_F", "", "", "", [], [], ""], 1];
- Example 4:
- Add all weapons on player with attachments:
{ cursorObject addWeaponWithAttachmentsCargo [_x, 1] } forEach weaponsItems player;
Additional Information
- See also:
- weaponsItemsaddWeaponCargoaddWeaponCargoGlobalclearWeaponCargogetWeaponCargoaddWeaponWithAttachmentsCargoGlobal
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 - 21:03 (UTC)
- Andrew_S90
-
This command also allows you to add a weapon with attachments directly to the players backpack.
(backpackContainer player) addWeaponWithAttachmentsCargo [ ["arifle_MX_F","muzzle_snds_H","acc_pointer_IR","optic_Hamr",["30Rnd_65x39_caseless_mag",30],[],"bipod_03_F_blk"], 1];