addWeaponWithAttachmentsCargo: Difference between revisions
Jump to navigation
Jump to search
(Implement latest changes) |
Killzone Kid (talk | contribs) (Syntax changes in 145819) |
||
Line 11: | Line 11: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| | | 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 <br><br> | ||
{{Important | This command has [[local]] effect. For a global variant use [[addWeaponWithAttachmentsCargoGlobal]] }} |Description= | |||
{{Important| | |||
}}|Description= | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| container addWeaponWithAttachmentsCargo [weapon, | | container [[addWeaponWithAttachmentsCargo]] <nowiki>[</nowiki>[weapon, muzzle, flashlight, optics, [primaryMuzzleMagazine, ammoCount], [secondaryMuzzleMagazine, ammoCount], bipod], weaponsCount] |SYNTAX= | ||
|p10= | |p1= container: [[Object]] - Container to add the weapon to, might be backpack, ammobox or vehicle |Parameter 1= | ||
|p2= <nowiki>[</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 |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 |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= | | [[Nothing]] |Return Value= | ||
Line 49: | Line 37: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x1= <code> | |x1= <code>[[cursorObject]] [[addWeaponWithAttachmentsCargo]] <nowiki>[</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= <code> | |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]] [[addWeaponWithAttachmentsCargo]] <nowiki>[</nowiki>["arifle_MX_GL_F", "", "acc_flashlight", "", ["30Rnd_65x39_caseless_mag", $DEAD], ["3Rnd_HE_Grenade_shell", $DEAD], ""], 5]</code> |Example 2= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x3= <code> | |x3= Add one MX rifle without any attachments or magazines event though the class has linked items: <code>[[cursorObject]] [[addWeaponWithAttachmentsCargo]] <nowiki>[</nowiki>["arifle_MX_Holo_pointer_F", "", "", "", [], [], ""], 1];</code> |Example 3= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x4= Add all weapons on player with attachments: <code>{ [[cursorObject]] [[addWeaponWithAttachmentsCargo]] [_x, 1] } [[forEach]] [[weaponsItems]] [[player]];</code> |Example 4= | |||
| [[addWeaponWithAttachmentsCargoGlobal]], [[addWeaponCargo]], [[addWeaponCargoGlobal]], [[clearWeaponCargo]], [[getWeaponCargo]], |See Also= | | [[addWeaponWithAttachmentsCargoGlobal]], [[addWeaponCargo]], [[addWeaponCargoGlobal]], [[clearWeaponCargo]], [[getWeaponCargo]], |See Also= | ||
}} | }} | ||
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]] | ||
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]] |
Revision as of 14:20, 2 July 2019
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:
- Uncategorised
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
- [secondaryMuzzleMagazine, ammoCount]: Array - Secondary muzzle magazine info or [] if not needed
- secondaryMuzzleMagazine: String - Magazine class name
- ammoCount: Number - Ammo count in magazine
- 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 round 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", $DEAD], ["3Rnd_HE_Grenade_shell", $DEAD], ""], 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:
- 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.95]][[ Category: arma3dev: New Scripting Commands | ADDWEAPONWITHATTACHMENTSCARGO]][[ Category: arma3dev: Scripting Commands | ADDWEAPONWITHATTACHMENTSCARGO]]