Vn_ms_fnc_hasItems

From Savage Game Design Wiki
Jump to navigation Jump to search
← back to Functions Introduced in S.O.G. Prairie Fire v1.00
by Wyqer, veteran29
Argument(s): n/a
Effect(s): unknown

Description

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

Syntax

Syntax
[_units,_items,_all] call vn_ms_fnc_hasItems;
Parameters
_units: Array - (Optional, default []) Array of units and/or groups to check for the item.
_items: Array - (Optional, default []) Array of item classnames to check for in their inventories.
_all: Boolean - (Optional, default true) 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