Arma 3 Scripting

Command in Unit Inventory

canAddItemToVest

Also available as Markdown and JSON, or read the original wiki page.

Description

Checks if given object can be stored into soldier's vest.

Important

Avoid passing an empty string "" to this command as it will create a warning dialog:

This message will show once per mission restart.

Syntax

Syntax 1

unit canAddItemToVest item

Parameters:

Returns: Boolean

Syntax 2

since arma3 1.56

unit canAddItemToVest [item, count, ignoreSoldierMaxLoad]

Parameters:

Returns: Boolean

Examples

Example 1

_item = "HandGrenade";
private _fits = player canAddItemToVest _item;
if (_fits) then {
    player addItemToVest _item;
} else {
    hint "no room!";
};

See also

canAdd · canAddItemToBackpack · canAddItemToUniform