ACE3/addons/explosives/functions/fnc_getDetonators.sqf

35 lines
665 B
Plaintext
Raw Normal View History

/*
* Author: Garth 'L-H' de Wet
* Returns all the detonators of the unit
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Configs of all detonators <ARRAY>
*
* Example:
* _detonators = [player] call ACE_Explosives_fnc_getDetonators;
*
* Public: Yes
*/
#include "script_component.hpp"
2015-04-29 05:05:02 +00:00
// IGNORE_PRIVATE_WARNING(_detonators);
2015-08-15 19:35:33 +00:00
params ["_unit"];
TRACE_1("params",_unit);
private ["_items", "_result", "_config"];
_items = (items _unit);
_result = [];
{
_config = ConfigFile >> "CfgWeapons" >> _x;
if (getNumber (_config >> "ACE_Detonator") == 1 && {!(_x in _result)}) then {
_result pushBack _x;
};
} forEach _items;
_result