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