addWeaponWithAttachmentsCargo

From Bohemia Interactive Community
Jump to navigation Jump to search
Introduced with Arma 3 Development Branch version 1.95
  Arguments of this scripting command don't have to be local to the client the command is executed onEffects of this scripting command are not broadcasted over the network and remain local to the client the command is executed on

Click on the images for descriptions

Introduced in

Game:
Arma 3 Development Branch
Version:
1.95

Description

Description:
Add a weapon into cargo space of vehicles, but with pre-attached attachments/magazines. Ignores available cargo space.
This clears all pre-attached items if the weapon class has LinkedItems.

The cargo object this is applied on can be remote. But only local player will see the changed inventory.
You most likely want addWeaponWithAttachmentsCargoGlobal in any multiplayer scenario

Syntax

Syntax:
container addWeaponWithAttachmentsCargo [weapon, muzzleAttachment, sideAttachment, topAttachment, bipodAttachment, [(primaryMagazine), (primaryAmmoCount), (secondaryMagazine), (secondaryAmmoCount)], (count)]
Parameters:
container: Object - Container to add the weapon to, might be backpack, ammobox or vehicle.
weapon: String - Weapon classname. See the topic Category:Weapons for reference about possible values.
muzzleAttachment: String - Muzzle attachment classname. If you don't want any just supply empty string.
sideAttachment: String - Side rail attachment classname. If you don't want any just supply empty string.
topAttachment: String - Top rail attachment classname. If you don't want any just supply empty string.
bipodAttachment: String - Underbarrel rail attachment classname. If you don't want any just supply empty string.
primaryMagazine (Optional): String - Primary magazine classname. If you don't want any just supply empty string or leave the whole magazine array empty.
primaryAmmoCount (Optional): Number - Ammo count in primary magazine. If you want a full magazine you can use -1.
secondaryMagazine (Optional): String - Secondary magazine classname. If you don't want any just supply empty string or leave the whole magazine array empty.
secondaryAmmoCount (Optional): Number - Ammo count in secondary magazine. If you want a full magazine you can use -1.
count (Optional): Number - Number of weapons to add. Default is 1.
Return Value:
Nothing

Examples

Example 1:
cursorTarget addWeaponWithAttachmentsCargo ["arifle_MX_GL_F", "muzzle_snds_H", "acc_flashlight", "optic_aco", "", ["30Rnd_65x39_caseless_mag", 15, "3Rnd_HE_Grenade_shell", 2], 2]
Example 2:
cursorTarget addWeaponWithAttachmentsCargo ["arifle_MX_GL_F", "", "acc_flashlight", "", "", ["30Rnd_65x39_caseless_mag", 30, "3Rnd_HE_Grenade_shell"], 2] Add's two MX GL rifles with flashlight side attachment and a full 30 round magazine loaded into the gun, and 3Rnd HE grenade magazine loaded into the grenade launcher
Example 3:
cursorTarget addWeaponWithAttachmentsCargo ["arifle_MX_GL_F", "", "", "", "", []] Same as a simple addWeaponCargo. This is the minimum number of arguments you need to supply.

Additional Information

Multiplayer:
-
See also:
addWeaponWithAttachmentsCargoGlobaladdWeaponCargoaddWeaponCargoGlobalclearWeaponCargogetWeaponCargo,

Notes

Only post proven facts here. Report bugs on the feedback tracker. Use the talk page or the forums for discussions.
Add New Note | How To

Bottom Section