ACE3/addons/refuel/functions/fnc_getFuel.sqf
Githawk 5e103ba398 Added nozzle
Added code for nozzle object
Params and private update
2016-02-02 15:03:06 +01:00

28 lines
565 B
Plaintext

/*
* Author: GitHawk, Jonpas
* Get the remaining fuel amount.
*
* Arguments:
* 0: Target <OBJECT>
*
* Return Value:
* Fuel left (in liters) <NUMBER>
*
* Example:
* [fuelTruck] call ace_refuel_fnc_getFuel
*
* Public: No
*/
#include "script_component.hpp"
params [["_target", objNull, [objNull]]];
private _fuel = _target getVariable QGVAR(currentFuelCargo);
if (isNil "_fuel") then {
_fuel = getNumber (configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(fuelCargo));
_target setVariable [QGVAR(currentFuelCargo), _fuel, true];
};
_fuel