2015-08-13 17:33:55 +00:00
|
|
|
/*
|
|
|
|
* Author: GitHawk
|
|
|
|
* Get the remaining fuel amount
|
|
|
|
*
|
|
|
|
* Arguments:
|
2015-08-20 20:10:26 +00:00
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
* 1: Fuel Truck <OBJECT>
|
2015-08-13 17:33:55 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2015-08-14 01:18:54 +00:00
|
|
|
* None
|
2015-08-13 17:33:55 +00:00
|
|
|
*
|
|
|
|
* Example:
|
2015-08-21 20:43:45 +00:00
|
|
|
* [player, fuelTruck] call ace_refuel_fnc_checkFuel
|
2015-08-13 17:33:55 +00:00
|
|
|
*
|
2015-08-14 01:18:54 +00:00
|
|
|
* Public: No
|
2015-08-13 17:33:55 +00:00
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-02-02 14:03:06 +00:00
|
|
|
params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]]];
|
|
|
|
|
|
|
|
private _fuel = [_target] call FUNC(getFuel);
|
2015-08-13 17:33:55 +00:00
|
|
|
|
|
|
|
[
|
|
|
|
5,
|
|
|
|
[_unit, _target, _fuel],
|
|
|
|
{
|
|
|
|
params ["_args"];
|
2016-02-02 14:03:06 +00:00
|
|
|
_args params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]], ["_fuel", 0, [0]]];
|
2015-08-13 17:33:55 +00:00
|
|
|
if (_fuel > 0 ) then {
|
2016-03-05 17:16:09 +00:00
|
|
|
["displayTextStructured", _unit, [[LSTRING(Hint_RemainingFuel), _fuel], 2, _unit]] call EFUNC(common,objectEvent);
|
2015-08-13 17:33:55 +00:00
|
|
|
} else {
|
2016-03-05 17:16:09 +00:00
|
|
|
["displayTextStructured", _unit, [LSTRING(Hint_Empty), 2, _unit]] call EFUNC(common,objectEvent);
|
2015-08-13 17:33:55 +00:00
|
|
|
};
|
|
|
|
true
|
|
|
|
},
|
|
|
|
{true},
|
2015-08-21 20:43:45 +00:00
|
|
|
localize LSTRING(CheckFuelAction),
|
2015-08-13 17:33:55 +00:00
|
|
|
{true},
|
|
|
|
["isnotinside"]
|
|
|
|
] call EFUNC(common,progressBar);
|