---
name: "BIS_fnc_arsenal"
type: function
status: ok
groups: ["Inventory"]
arma3_since: "1.24"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_arsenal
revid: 364490
updated: 2024-05-16T20:41:59Z
---

# BIS_fnc_arsenal

*Function · Inventory · Arma 3 v1.24*

## Description

Function used for the Virtual Arsenal. The function features four different modes, each mode comes with its own parameters.

> [!NOTE]
> If Arsenal is launched within the first second from the mission start, the unit loadout will be randomised.

## Syntax

```sqf
[mode, params] call BIS_fnc_arsenal
```

**Parameters:**

- `mode`: [String](../topics/String.md) - mode, can be one of:
  - "Open" - opens the Arsenal
  - "Preload" - preloads item configs, without preloading the configs are parsed the first time it is opened
  - "AmmoboxInit" - adds a virtual ammobox. Action to access the Arsenal will be added automatically to all clients
  - "AmmoboxExit" - remove virtual ammobox
- `params`: [Anything](../topics/Anything.md) - mode parameters:
  - **"Open"**: [full, cargo, center]
    - full: [Boolean](../topics/Boolean.md) - (Optional, default [false](../commands/false.md)) [true](../commands/true.md) to open full Arsenal with all items available
    - cargo: Object to use as the cargo carrier (cargo is added with the [BIS_fnc_addVirtualItemCargo](../functions/BIS_fnc_addVirtualItemCargo.md) functions)
    - center: Object whose arsenal will be modified
  - **"Preload"**: no parameters
  - **"AmmoboxInit"**: [ammobox, allItems, condition]
    - ammobox: [Object](../topics/Object.md) - Object which should get a virtual ammobox
    - allItems: [Boolean](../topics/Boolean.md) - (Optional, default [false](../commands/false.md)) [true](../commands/true.md) to make all items available
    - condition: [Code](../topics/Code.md) - (Optional, default `{ true }`) condition for the Arsenal to be accessible. Available arguments are the same as in [addAction](../commands/addAction.md)'s *condition* parameter:
      - _target: [Object](../topics/Object.md) - object to which the action is attached or, if the object is a unit inside of vehicle, the vehicle
      - _this: [Object](../topics/Object.md) - caller person to whom the action is shown (or not depending on *condition*)
      - _originalTarget: [Object](../topics/Object.md) - original object to which the action is attached, regardless if the object/unit is in a vehicle or not
  - **"AmmoboxExit"**: [ammobox]
    - ammobox: [Object](../topics/Object.md) - the object to which the Arsenal was added

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

## Examples

### Example 1

Opens Arsenal with all items:

```sqf
["Open", [true]] call BIS_fnc_arsenal;
```

### Example 2

Preloads Arsenal's config:

```sqf
["Preload"] call BIS_fnc_arsenal;
```

### Example 3

Adds full Arsenal to the [player](../commands/player.md) object and makes the [action](../commands/addAction.md) available when the player is closer than 10 meters from ammoBox:

```sqf
["AmmoboxInit", [ammoBox, true, { _this distance _target  < 10 }]] call BIS_fnc_arsenal;
```

### Example 4

Removes Arsenal from player object:

```sqf
["AmmoboxExit", player] call BIS_fnc_arsenal;
```

## See also

Arma 3: Arsenal · [BIS_fnc_garage](../functions/BIS_fnc_garage.md)

<sub>Source: [BI Community Wiki — BIS fnc arsenal](https://community.bistudio.com/wiki/BIS_fnc_arsenal) (revision 364490).</sub>
