2016-02-27 19:31:07 +00:00
|
|
|
/*
|
|
|
|
* Author: GitHawk
|
2017-06-08 16:47:52 +00:00
|
|
|
* Sets the supply count. [Global Effects]
|
2016-02-27 19:31:07 +00:00
|
|
|
*
|
2016-06-06 18:42:20 +00:00
|
|
|
* Arguments:
|
2016-02-27 20:05:19 +00:00
|
|
|
* 0: Ammo Truck <OBJECT>
|
2016-02-27 19:31:07 +00:00
|
|
|
* 1: Supply Count <NUMBER>
|
|
|
|
*
|
2016-06-06 18:42:20 +00:00
|
|
|
* Return Value:
|
2016-02-27 19:31:07 +00:00
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [ammo_truck, 1000] call ace_rearm_fnc_setSupplyCount
|
|
|
|
*
|
|
|
|
* Public: Yes
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2017-06-08 16:47:52 +00:00
|
|
|
if !(EGVAR(common,settingsInitFinished)) exitWith { // only run this after the settings are initialized
|
|
|
|
EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(setSupplyCount), _this];
|
|
|
|
};
|
2016-02-27 19:31:07 +00:00
|
|
|
|
2017-06-08 16:47:52 +00:00
|
|
|
params [["_truck", objNull, [objNull]], ["_supply", 0, [0]]];
|
|
|
|
|
|
|
|
if (GVAR(supply) != 1) exitWith {WARNING("supply setting is not set to limited");};
|
2017-09-29 19:53:25 +00:00
|
|
|
if (isNull _truck) exitWith {WARNING_1("Truck is null [%1]",_truck);};
|
2016-02-27 19:31:07 +00:00
|
|
|
|
2016-02-27 20:05:19 +00:00
|
|
|
_truck setVariable [QGVAR(currentSupply), (_supply max 0), true];
|