addWeaponWithAttachmentsCargo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "dreadedentity" to "DreadedEntity")
m (Some wiki formatting)
Line 34: Line 34:
|r1= [[Nothing]]
|r1= [[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= <sqf>cursorObject addWeaponWithAttachmentsCargo [["arifle_MX_GL_F", "muzzle_snds_H", "", "optic_aco", ["30Rnd_65x39_caseless_mag", 15], ["3Rnd_HE_Grenade_shell", 2], ""], 2];</sqf>
</code>


|x2= Add five MX GL rifles, each with flashlight side attachment, a full 30 rounds magazine loaded into the gun and a full 3Rnd HE grenade magazine loaded into the grenade launcher:
|x2= Add five MX GL rifles, each with flashlight side attachment, a full 30 rounds magazine loaded into the gun and a 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>
<sqf>cursorObject addWeaponWithAttachmentsCargo [["arifle_MX_GL_F", "", "acc_flashlight", "", ["30Rnd_65x39_caseless_mag", 30], ["3Rnd_HE_Grenade_shell", 2], ""], 5];</sqf>


|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>
<sqf>cursorObject addWeaponWithAttachmentsCargo [["arifle_MX_Holo_pointer_F", "", "", "", [], [], ""], 1];</sqf>


|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>
<sqf>{ cursorObject addWeaponWithAttachmentsCargo [_x, 1] } forEach weaponsItems player;</sqf>


|seealso= [[addWeaponWithAttachmentsCargoGlobal]] [[weaponsItems]] [[addWeaponCargo]] [[addWeaponCargoGlobal]] [[clearWeaponCargo]] [[getWeaponCargo]]
|seealso= [[addWeaponWithAttachmentsCargoGlobal]] [[weaponsItems]] [[addWeaponCargo]] [[addWeaponCargoGlobal]] [[clearWeaponCargo]] [[getWeaponCargo]]
}}
}}


{{Note
|user= Andrew_S90
|timestamp= 20201028210300
|text= This command also allows you to add a weapon with attachments directly to the players backpack.
<sqf>(backpackContainer player) addWeaponWithAttachmentsCargo [["arifle_MX_F","muzzle_snds_H","acc_pointer_IR","optic_Hamr",["30Rnd_65x39_caseless_mag",30],[],"bipod_03_F_blk"], 1];</sqf>
}}


<dl class="command_description">
{{Note
 
|user= DreadedEntity
<dt></dt>
|timestamp= 20220402025200
<dd class="notedate">Posted on October 28, 2020 - 21:03 (UTC)</dd>
|text= This command will let you add millions of weapons across multiple vehicles, but be warned, weird things start happening in-game:
<dt class="note">[[User:Andrew_S90|Andrew_S90]]</dt>
<sqf>(vehicle player) addWeaponWithAttachmentsCargoGlobal [["arifle_MX_F","","","",[],[],""],1000000];</sqf>
<dd class="note">
This command also allows you to add a weapon with attachments directly to the players backpack.
<code>(backpackContainer player) addWeaponWithAttachmentsCargo [ ["arifle_MX_F","muzzle_snds_H","acc_pointer_IR","optic_Hamr",["30Rnd_65x39_caseless_mag",30],[],"bipod_03_F_blk"], 1];</code>
</dd>
 
 
 
<dd class="notedate">Posted on April 2, 2022 - 02:52 (UTC)</dd>
<dt class="note">[[User:DreadedEntity|DreadedEntity]]</dt>
<dd class="note">
This command will let you add millions of weapons across multiple vehicles, but be warned, weird things start happening in-game:
<code>(vehicle player) addWeaponWithAttachmentsCargoGlobal [["arifle_MX_F","","","",[],[],""],1000000];</code>
I don't recommend running the above too many times in the console
I don't recommend running the above too many times in the console
</dd>
}}
</dl>

Revision as of 15:52, 3 May 2022

Hover & click on the images for description

Description

Description:
Adds a weapon into the 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 [weaponConfiguration, weaponsCount]
Parameters:
container: Object - Container to add the weapon to. Might be a backpack, ammobox or vehicle.
weaponConfiguration: Array in format [weapon, muzzle, flashlight, optics, primaryMuzzle, secondaryMuzzle, bipod]
  • weapon: String - Weapon class name from CfgWeapons
  • muzzle: String - Muzzle attachment class name. Use "" if not needed.
  • flashlight: String - Side rail attachment class name. Use "" if not needed.
  • optics: String - Top rail attachment class name. Use "" if not needed.
  • primaryMuzzle: Array in format [primaryMuzzleMagazine, primaryAmmoCount] - Use [] if not needed
    • primaryMuzzleMagazine: String - Magazine class name
    • primaryAmmoCount: Number - Ammo count in magazine (will be clipped to values between 0 and the maximum capacity of the magazine class)
  • secondaryMuzzle: Array in format [secondaryMuzzleMagazine, secondaryAmmoCount] - Use [] if not needed
    • secondaryMuzzleMagazine: String - Magazine class name
    • secondaryAmmoCount: Number - Ammo count in magazine (will be clipped to values between 0 and the maximum capacity of the magazine class)
  • bipod: String - Underbarrel rail attachment class name. Use "" if not needed.
This array has the same format as the array returned by the weaponsItems command.
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, each with flashlight side attachment, a full 30 rounds magazine loaded into the gun and a 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:
addWeaponWithAttachmentsCargoGlobal weaponsItems addWeaponCargo addWeaponCargoGlobal clearWeaponCargo getWeaponCargo

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
Andrew_S90 - c
Posted on Oct 28, 2020 - 21:03 (UTC)
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];
DreadedEntity - c
Posted on Apr 02, 2022 - 02:52 (UTC)
This command will let you add millions of weapons across multiple vehicles, but be warned, weird things start happening in-game:
(vehicle player) addWeaponWithAttachmentsCargoGlobal [["arifle_MX_F","","","",[],[],""],1000000];
I don't recommend running the above too many times in the console