2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-02-18 04:37:04 +00:00
|
|
|
/*
|
|
|
|
* Author: marc_book
|
|
|
|
* Starts refueling/recharging the 'Dartar' UAVs
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Player <OBJECT>
|
|
|
|
* 1: UAV <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
2017-06-08 13:31:51 +00:00
|
|
|
* None
|
2015-02-18 04:37:04 +00:00
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [player, theUAV] call ace_logistics_uavbattery_fnc_refuelUAV
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-08-15 22:07:17 +00:00
|
|
|
params ["_caller", "_target"];
|
2015-04-18 03:40:37 +00:00
|
|
|
|
2024-06-18 14:08:03 +00:00
|
|
|
if !(_this call FUNC(canRefuelUAV)) exitWith {};
|
2015-01-28 20:29:43 +00:00
|
|
|
|
2016-09-04 14:44:22 +00:00
|
|
|
private _onFinish = {
|
2015-08-15 22:07:17 +00:00
|
|
|
(_this select 0) params ["_caller", "_target"];
|
|
|
|
_caller removeItem "ACE_UAVBattery";
|
|
|
|
playSound3D [QUOTE(PATHTO_R(sounds\exchange_battery.ogg)), objNull, false, getPosASL _caller, 1, 1, 10];
|
2016-06-04 10:12:56 +00:00
|
|
|
[QEGVAR(common,setFuel), [_target, 1], [_target]] call CBA_fnc_targetEvent; //setFuel is local
|
2015-01-28 20:29:43 +00:00
|
|
|
};
|
|
|
|
|
2016-09-04 14:44:22 +00:00
|
|
|
private _onFailure = {
|
2015-08-15 22:07:17 +00:00
|
|
|
(_this select 0) params ["_caller", "_target"];
|
|
|
|
[_caller, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation);
|
2015-01-28 20:29:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
[_caller, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation);
|
|
|
|
|
2015-05-28 19:59:04 +00:00
|
|
|
[10, [_caller, _target], _onFinish, _onFailure, (localize LSTRING(Battery_Recharge)), {(_this select 0) call FUNC(canRefuelUAV)}] call EFUNC(common,progressBar);
|