ACE3/addons/refuel/functions/fnc_checkFuel.sqf

41 lines
994 B
Plaintext
Raw Normal View History

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"
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"];
_args params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]], ["_fuel", 0, [0]]];
2015-08-13 17:33:55 +00:00
if (_fuel > 0 ) then {
2016-05-24 13:13:11 +00:00
["ace_displayTextStructured", [[LSTRING(Hint_RemainingFuel), _fuel], 2, _unit], _unit] call CBA_fnc_targetEvent;
2015-08-13 17:33:55 +00:00
} else {
2016-05-24 13:13:11 +00:00
["ace_displayTextStructured", [LSTRING(Hint_Empty), 2, _unit], _unit] call CBA_fnc_targetEvent;
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);