Skip to content
vn_ms_fnc_hasItems

vn_ms_fnc_hasItems

Checks if given units have at least one of each given item in their inventory.

Syntax

[_units,_items,_all] call vn_ms_fnc_hasItems;

Parameters

ParameterTypeDefaultDescription
_units Array[] Array of units and/or groups to check for the item.
_items Array[] Array of item classnames to check for in their inventories.
_all Booleantrue Selector if all items should be in the inventory at least once or just one of the items are needed.

Return value

Boolean - At least one of each item is in the inventory of provided groups.

Examples

Example 1

[ [player], ["vn_mine_m18_mag", "vn_mine_m18_x3_mag"] ] call vn_ms_fnc_hasItems
// Both listed items are need to be at least once in the inventory

Example 2

[ [player], ["vn_mine_m18_mag", "vn_mine_m18_x3_mag"], false ] call vn_ms_fnc_hasItems
// One of the listed items needs to be at least once in the inventory

Documented by Wyqer, veteran29.