2015-07-03 21:14:23 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Use Equipment if any is available.
|
|
|
|
*
|
|
|
|
* Arguments:
|
2015-08-16 18:14:54 +00:00
|
|
|
* 0: Unit <OBJECT>
|
2015-09-26 04:36:35 +00:00
|
|
|
* 1: Item classname <STRING>
|
2015-07-03 21:14:23 +00:00
|
|
|
*
|
|
|
|
* ReturnValue:
|
2015-09-26 04:36:35 +00:00
|
|
|
* [Had Item to Use <BOOL>, Unit <OBJECT>] <ARRAY>
|
2015-08-16 18:14:54 +00:00
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [unit, "classname"] call ace_repair_fnc_useItem
|
2015-07-03 21:14:23 +00:00
|
|
|
*
|
|
|
|
* Public: Yes
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-16 18:14:54 +00:00
|
|
|
params ["_unit", "_item"];
|
|
|
|
TRACE_2("params",_unit,_item);
|
2015-07-03 21:14:23 +00:00
|
|
|
|
2015-11-10 02:11:48 +00:00
|
|
|
if ([_unit, _item] call EFUNC(common,hasItem)) exitWith {
|
2016-04-08 18:43:26 +00:00
|
|
|
[[_unit, _item], QEFUNC(common,useItem), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
2015-08-16 18:14:54 +00:00
|
|
|
[true, _unit];
|
2015-07-03 21:14:23 +00:00
|
|
|
};
|
2015-09-26 04:36:35 +00:00
|
|
|
|
2015-07-03 21:14:23 +00:00
|
|
|
[false, objNull];
|