---
name: "addWeaponWithAttachmentsCargoGlobal"
type: command
status: ok
groups: ["Vehicle Inventory"]
arma3_since: "1.94"
locality: {"argument": "global", "effect": "global", "server_exec": false}
source: https://community.bistudio.com/wiki/addWeaponWithAttachmentsCargoGlobal
revid: 377640
updated: 2026-01-02T08:52:38Z
---

# addWeaponWithAttachmentsCargoGlobal

*Command · Vehicle Inventory · Arma 3 v1.94*

Locality: arguments **global** · effect **global**

## 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.

## Syntax

```sqf
container addWeaponWithAttachmentsCargoGlobal [weaponConfiguration, weaponsCount]
```

**Parameters:**

- `container`: [Object](../topics/Object.md) - container to add the weapon to. Might be a backpack, ammobox or vehicle.
- `weaponConfiguration`: [Array](../topics/Array.md) with [weapon, muzzle, flashlight, optics, primaryMuzzle, secondaryMuzzle, bipod]
  - weapon: [String](../topics/String.md) - Weapon class name from CfgWeapons
  - muzzle: [String](../topics/String.md) - Muzzle attachment class name. Use "" if not needed.
  - flashlight: [String](../topics/String.md) - Side rail attachment class name. Use "" if not needed.
  - optics: [String](../topics/String.md) - Top rail attachment class name. Use "" if not needed.
  - primaryMuzzle: [Array](../topics/Array.md) with [primaryMuzzleMagazine, primaryAmmoCount] - Use [] if not needed
    - primaryMuzzleMagazine: [String](../topics/String.md) - Magazine class name
    - primaryAmmoCount: [Number](../topics/Number.md) - Ammo count in magazine (will be clipped to values between 0 and the maximum capacity of the magazine class)
  - secondaryMuzzle: [Array](../topics/Array.md) with [secondaryMuzzleMagazine, secondaryAmmoCount] - Use [] if not needed
    - secondaryMuzzleMagazine: [String](../topics/String.md) - Magazine class name
    - secondaryAmmoCount: [Number](../topics/Number.md) - Ammo count in magazine (will be clipped to values between 0 and the maximum capacity of the magazine class)
  - bipod: [String](../topics/String.md) - Underbarrel rail attachment class name. Use "" if not needed.
  This array has the same format as the array returned by the [weaponsItems](../commands/weaponsItems.md) command.
- `weaponsCount`: [Number](../topics/Number.md) - number of weapons to add

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
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:

```sqf
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:

```sqf
cursorObject addWeaponWithAttachmentsCargoGlobal [["arifle_MX_Holo_pointer_F", "", "", "", [], [], ""], 1];
```

### Example 4

Add all weapons on player with attachments:

```sqf
{ cursorObject addWeaponWithAttachmentsCargoGlobal [_x, 1] } forEach weaponsItems player;
```

## See also

[addWeaponWithAttachmentsCargo](../commands/addWeaponWithAttachmentsCargo.md) · [weaponsItems](../commands/weaponsItems.md) · [addWeaponCargo](../commands/addWeaponCargo.md) · [addWeaponCargoGlobal](../commands/addWeaponCargoGlobal.md) · [clearWeaponCargo](../commands/clearWeaponCargo.md) · [getWeaponCargo](../commands/getWeaponCargo.md)

## Community notes

**Andrew_S90** — 2020-10-28

This command also allows you to add a weapon with attachments directly to the players backpack.

```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];
```

<sub>Source: [BI Community Wiki — addWeaponWithAttachmentsCargoGlobal](https://community.bistudio.com/wiki/addWeaponWithAttachmentsCargoGlobal) (revision 377640).</sub>
