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:
|
|
|
|
* Nothing
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [player, theUAV] call ace_logistics_uavbattery_fnc_refuelUAV
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-01-28 20:29:43 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
PARAMS_2(_caller,_target);
|
|
|
|
|
|
|
|
if (!(_this call FUNC(canRefuelUAV))) exitWith {};
|
|
|
|
|
|
|
|
_onFinish = {
|
|
|
|
EXPLODE_2_PVT((_this select 0),_caller,_target);
|
|
|
|
_caller removeItem "ACE_UAVBattery";
|
2015-02-15 11:44:34 +00:00
|
|
|
playSound3D [QUOTE(PATHTO_R(sounds\exchange_battery.ogg)), objNull, false, getPosASL _caller, 1, 1, 10];
|
2015-01-28 20:38:04 +00:00
|
|
|
["VehicleSetFuel", [_target], [_target, 1]] call EFUNC(common,targetEvent); //setFuel is local
|
2015-01-28 20:29:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
_onFailure = {
|
|
|
|
EXPLODE_2_PVT((_this select 0),_caller,_target);
|
|
|
|
[_caller, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation);
|
|
|
|
};
|
|
|
|
|
|
|
|
[_caller, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation);
|
|
|
|
|
|
|
|
[10, [_caller, _target], _onFinish, _onFailure, (localize "STR_ACE_logistics_uavbattery_Battery_Recharge"), {(_this select 0) call FUNC(canRefuelUAV)}] call EFUNC(common,progressBar);
|