ACE3/addons/refuel/functions/fnc_readFuelCounter.sqf
Ozan Eğitmen 41e1b25397 Refuel: Turn on nozzle after connection (#5426)
* Turn on nozzle after connection

* Remove some superflous progress bars

* Handle tempFuel var

* Handle conflicts 2: conflict harder

* Remove duplicate code
2017-09-21 16:24:58 +02:00

30 lines
761 B
Plaintext

/*
* Author: GitHawk
* Reads the fuel counter.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Fuel Source <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player, fuelTruck] call ace_refuel_fnc_readFuelCounter
*
* Public: No
*/
#include "script_component.hpp"
params [["_unit", objNull, [objNull]], ["_source", objNull, [objNull]]];
private _currentFuel = [_source] call FUNC(getFuel);
private _fuelCounter = if (_currentFuel == REFUEL_INFINITE_FUEL) then {
_source getVariable [QGVAR(fuelCounter), 0]
} else {
(_source getVariable [QGVAR(fuelCounter), _currentFuel]) - _currentFuel
};
private _fuelCounter = 0.01 * round (100 * _fuelCounter);
[[LSTRING(Hint_FuelCounter), _fuelCounter], 1.5, _unit] call EFUNC(common,displayTextStructured);