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"
|
2015-08-17 22:42:35 +00:00
|
|
|
private ["_fuel"];
|
2015-08-13 17:33:55 +00:00
|
|
|
params ["_unit", "_target"];
|
|
|
|
|
2015-08-16 23:57:05 +00:00
|
|
|
_fuel = [_target] call FUNC(getFuel);
|
2015-08-13 17:33:55 +00:00
|
|
|
|
|
|
|
[
|
|
|
|
5,
|
|
|
|
[_unit, _target, _fuel],
|
|
|
|
{
|
|
|
|
params ["_args"];
|
2015-08-14 01:18:54 +00:00
|
|
|
_args params ["_unit", "_target", "_fuel"];
|
2015-08-13 17:33:55 +00:00
|
|
|
if (_fuel > 0 ) then {
|
|
|
|
["displayTextStructured", [_unit], [[LSTRING(Hint_RemainingFuel), _fuel], 2, _unit]] call EFUNC(common,targetEvent);
|
|
|
|
} else {
|
|
|
|
["displayTextStructured", [_unit], [LSTRING(Hint_Empty), 2, _unit]] call EFUNC(common,targetEvent);
|
|
|
|
};
|
|
|
|
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);
|