ACE3/addons/rearm/functions/fnc_getSupplyCount.sqf
2016-02-27 21:05:19 +01:00

28 lines
554 B
Plaintext

/*
* Author: GitHawk
* Get the supply count.
*
* Argument:
* 0: Ammo Truck <OBJECT>
*
* Return value:
* Supply count <NUMBER>
*
* Example:
* [ammo_truck] call ace_rearm_fnc_getSupplyCount
*
* Public: Yes
*/
#include "script_component.hpp"
params [["_truck", objNull, [objNull]]];
private _supply = _truck getVariable QGVAR(currentSupply);
if (isNil "_supply") then {
_supply = getNumber (configFile >> "CfgVehicles" >> typeOf _truck >> QGVAR(defaultSupply));
_truck setVariable [QGVAR(currentSupply), _supply, true];
};
_supply