ACE3/addons/refuel/functions/fnc_checkFuel.sqf

41 lines
1.0 KiB
Plaintext
Raw Normal View History

#include "..\script_component.hpp"
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 Source <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
*/
params [["_unit", objNull, [objNull]], ["_source", objNull, [objNull]]];
private _fuel = [_source] call FUNC(getFuel);
2015-08-13 17:33:55 +00:00
[
GVAR(progressDuration) * 2,
[_unit, _source, _fuel],
2015-08-13 17:33:55 +00:00
{
params ["_args"];
_args params [["_unit", objNull, [objNull]], ["_source", objNull, [objNull]], ["_fuel", 0, [0]]];
2015-08-13 17:33:55 +00:00
if (_fuel > 0 ) then {
[QEGVAR(common,displayTextStructured), [[LSTRING(Hint_RemainingFuel), _fuel], 2, _unit], _unit] call CBA_fnc_targetEvent;
2015-08-13 17:33:55 +00:00
} else {
[QEGVAR(common,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},
[INTERACT_EXCEPTIONS]
2015-08-13 17:33:55 +00:00
] call EFUNC(common,progressBar);