ACE3/addons/rearm/functions/fnc_setSupplyCount.sqf
PabstMirror f35f80ee82 Rearm - Pylon Support and Dynamically Add Supply Actions (#5183)
* Dynamic Add

* Support 1.70 Pylon Loadouts

* Properly handle old compat pbos - Update RHS Compat

* Re-add documentation

* cleanup headers (note from other pr)

* Cleanup

* Fix var spelling
2017-06-08 11:47:52 -05:00

29 lines
767 B
Plaintext

/*
* Author: GitHawk
* Sets the supply count. [Global Effects]
*
* Arguments:
* 0: Ammo Truck <OBJECT>
* 1: Supply Count <NUMBER>
*
* Return Value:
* None
*
* Example:
* [ammo_truck, 1000] call ace_rearm_fnc_setSupplyCount
*
* Public: Yes
*/
#include "script_component.hpp"
if !(EGVAR(common,settingsInitFinished)) exitWith { // only run this after the settings are initialized
EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(setSupplyCount), _this];
};
params [["_truck", objNull, [objNull]], ["_supply", 0, [0]]];
if (GVAR(supply) != 1) exitWith {WARNING("supply setting is not set to limited");};
if (isNull _truck) exitWith {WARNING_1("Truck is null [%1]", _truck);};
_truck setVariable [QGVAR(currentSupply), (_supply max 0), true];