ACE3/addons/rearm/functions/fnc_getSupplyCount.sqf

30 lines
561 B
Plaintext
Raw Normal View History

2016-02-27 19:31:07 +00:00
/*
* Author: GitHawk
* Get the supply count.
*
* Arguments:
2016-02-27 20:05:19 +00:00
* 0: Ammo Truck <OBJECT>
2016-02-27 19:31:07 +00:00
*
* Return Value:
2016-02-27 19:31:07 +00:00
* Supply count <NUMBER>
*
* Example:
* [ammo_truck] call ace_rearm_fnc_getSupplyCount
*
* Public: Yes
*/
#include "script_component.hpp"
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