2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
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
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Return Value:
|
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
|
|
|
|
*/
|
|
|
|
|
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-06-09 12:25:57 +00:00
|
|
|
["ace_useItem", [_unit, _item], _unit] call CBA_fnc_targetEvent;
|
|
|
|
[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];
|