|
@@ -1,14 +1,18 @@
|
|
|
params["_player", "_target", "_params"];
|
|
|
-if(vehicle _target == _target) then
|
|
|
-{
|
|
|
- _canRefuel = [_player, ["lightsaberG_swing"]] call rd501_fnc_getRefuelMagazine;
|
|
|
- if(_canRefuel) then {
|
|
|
- _target setFuel 100;
|
|
|
- [format["Refuelled %1", _target], true, 2, 0] call ACE_common_fnc_displayText;
|
|
|
- }else
|
|
|
- {
|
|
|
- [format["No fuel", _target], true, 2, 0] call ACE_common_fnc_displayText;
|
|
|
- };
|
|
|
-}else{
|
|
|
- ["Cannot refuel this", true, 2, 0] call ACE_common_fnc_displayText;
|
|
|
-};
|
|
|
+if (!(_this call rd501_fnc_canRefuel)) exitWith {};
|
|
|
+
|
|
|
+private _onFinish = {
|
|
|
+ (_this select 0) params ["_player", "_target"];
|
|
|
+ _player removeItem "ACE_UAVBattery";
|
|
|
+ ["ace_common_setFuel", [_target, 1], [_target]] call CBA_fnc_targetEvent;
|
|
|
+ [format["Refuelled %1", _target], true, 2, 0] call ace_common_fnc_displayText;
|
|
|
+};
|
|
|
+
|
|
|
+private _onFailure = {
|
|
|
+ (_this select 0) params ["_player", "_target"];
|
|
|
+ [_player, "AmovPknlMstpSrasWrflDnon", 1] call ace_common_fnc_doAnimation;
|
|
|
+};
|
|
|
+
|
|
|
+[_player, "AinvPknlMstpSnonWnonDr_medic5", 0] call ace_common_fnc_doAnimation;
|
|
|
+
|
|
|
+[10, [_player, _target], _onFinish, _onFailure, ("Refueling"), {(_this select 0) call rd501_fnc_canRefuel}] call ace_common_fnc_progressBar;
|