addWeaponWithAttachmentsCargoGlobal: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *N([a-z ])" to "$1 - n$2")
 
(27 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma3 |Game=
|game1= arma3
|version1= 1.94


|1.94|Game Version=
|arg= global
|eff= global


|arg= global |Arguments in MP=
|gr1= Vehicle Inventory


|eff= global |Effects in MP=
|descr= 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.


|gr1= Vehicle Inventory |GROUP1=
|s1= container [[addWeaponWithAttachmentsCargoGlobal]] [weaponConfiguration, weaponsCount]
____________________________________________________________________________________________


| 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=
|p1= container: [[Object]] - container to add the weapon to. Might be a backpack, ammobox or vehicle.
____________________________________________________________________________________________


| container [[addWeaponWithAttachmentsCargoGlobal]] [<nowiki/>[weapon, muzzle, flashlight, optics, [primaryMuzzleMagazine, ammoCount], [secondaryMuzzleMagazine, ammoCount], bipod], weaponsCount] |SYNTAX=
|p2= weaponConfiguration: [[Array]] in format [weapon, muzzle, flashlight, optics, primaryMuzzle, secondaryMuzzle, bipod]
* weapon: [[String]] - Weapon class name from [[:Category:CfgWeapons|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.


|p1= container: [[Object]] - Container to add the weapon to, might be backpack, ammobox or vehicle |Parameter 1=
|p3= weaponsCount: [[Number]] - number of weapons to add
|p2= [<nowiki/>[weapon, muzzle, flashlight, optics, [primaryMuzzleMagazine, ammoCount], [secondaryMuzzleMagazine, ammoCount], bipod], weaponsCount]: [[Array]] |Parameter 2=
|p3= [weapon, muzzle, flashlight, optics, [primaryMuzzleMagazine, ammoCount], [secondaryMuzzleMagazine, ammoCount], bipod]: [[Array]] in format [[weaponsItems]] |Parameter 3=
|p4= weapon: [[String]] - Weapon class name. See the topic [[:Category:Weapons]] for reference about possible values |Parameter 4=
|p5= muzzle: [[String]] - Muzzle attachment class name or "" if not needed |Parameter 5=
|p6= flashlight: [[String]] - Side rail attachment class name or "" if not needed |Parameter 6=
|p7= optics: [[String]] - Top rail attachment class name or "" if not needed |Parameter 7=
|p8= [primaryMuzzleMagazine, ammoCount]: [[Array]] - Primary muzzle magazine info or [] if not needed|Parameter 8=
|p9= primaryMuzzleMagazine: [[String]] - Magazine class name |Parameter 9=
|p10= ammoCount: [[Number]] - Ammo count in magazine (will be clipped in 0 and max mag capacity range) |Parameter 10=
|p11= [secondaryMuzzleMagazine, ammoCount]: [[Array]] - Secondary muzzle magazine info or [] if not needed|Parameter 11=
|p12= secondaryMuzzleMagazine: [[String]] - Magazine class name |Parameter 12=
|p13= ammoCount: [[Number]] - Ammo count in magazine (will be clipped in 0 and max mag capacity range) |Parameter 13=
|p14= bipod: [[String]] - Underbarrel rail attachment class name or "" if not needed |Parameter 14=
|p15= weaponsCount: [[Number]] - Number of weapons to add |Parameter 15=


| [[Nothing]] |Return Value=
|r1= [[Nothing]]


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


|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];
|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> |Example 1=
<sqf>cursorObject addWeaponWithAttachmentsCargoGlobal [["arifle_MX_GL_F", "", "acc_flashlight", "", ["30Rnd_65x39_caseless_mag", 30], ["3Rnd_HE_Grenade_shell", 2], ""], 5];</sqf>
____________________________________________________________________________________________


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


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


|x4= Add all weapons on player with attachments: <code>{ [[cursorObject]] [[addWeaponWithAttachmentsCargoGlobal]] [_x, 1] } [[forEach]] [[weaponsItems]] [[player]];</code> |Example 4=
|seealso= [[addWeaponWithAttachmentsCargo]] [[weaponsItems]] [[addWeaponCargo]] [[addWeaponCargoGlobal]] [[clearWeaponCargo]] [[getWeaponCargo]]
 
| [[addWeaponWithAttachmentsCargo]], [[addWeaponCargo]], [[addWeaponCargoGlobal]], [[clearWeaponCargo]], [[getWeaponCargo]] |See Also=
}}
}}


[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
{{Note
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
|user= Andrew_S90
 
|timestamp= 20201028205700
{{subst:Add new note/construct|
|text= This command also allows you to add a weapon with attachments directly to the players backpack.
This command also works to add a weapon with attachments into the players/units backpack with attachments on it.
<sqf>(backpackContainer player) addWeaponWithAttachmentsCargoGlobal [["arifle_MX_F","muzzle_snds_H","acc_pointer_IR","optic_Hamr",["30Rnd_65x39_caseless_mag",30],[],"bipod_03_F_blk"], 1];</sqf>
 
(backpackContainer player) addWeaponWithAttachmentsCargoGlobal [["arifle_MX_F","muzzle_snds_H","acc_pointer_IR","optic_Hamr",["30Rnd_65x39_caseless_mag",30],[],"bipod_03_F_blk"],1];
 
}}
}}

Latest revision as of 15:39, 8 November 2023

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 addWeaponWithAttachmentsCargoGlobal [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 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, 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 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:
addWeaponWithAttachmentsCargo 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 - 20:57 (UTC)
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];