ACE3/addons/disarming/functions/fnc_getAllGearContainer.sqf

30 lines
635 B
Plaintext
Raw Normal View History

#include "script_component.hpp"
/*
* Author: PabstMirror
2015-08-09 03:18:26 +00:00
*
* Helper function to get all gear of a container
*
* Arguments:
* 0: Container <OBJECT>
*
* Return Value:
* Array of 2 arrays, classnames and count<ARRAY>
*
* Example:
* [["ace_bandage"],[2]] = [box] call ace_disarming_fnc_getAllGearContainer
*
* Public: No
*/
2015-02-27 21:23:46 +00:00
2015-08-09 03:18:26 +00:00
params ["_target"];
2015-02-27 21:23:46 +00:00
private _items = [];
private _counts = [];
2015-02-27 21:23:46 +00:00
{
2015-08-09 03:18:26 +00:00
_x params ["_item", "_count"];
2015-08-15 01:13:41 +00:00
_items append _item;
_counts append _count;
} forEach [(getWeaponCargo _target), (getItemCargo _target), (getMagazineCargo _target), (getBackpackCargo _target)];
2015-02-27 22:16:35 +00:00
2015-08-09 03:18:26 +00:00
[_items,_counts] // Return