ACE3/addons/rearm/functions/fnc_getSupplyCount.sqf
Githawk 9cfa2f11d9 Stuff
Arguments, Return Value, (optional)
2016-06-06 20:42:20 +02:00

30 lines
561 B
Plaintext

/*
* Author: GitHawk
* Get the supply count.
*
* Arguments:
* 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