ACE3/addons/rearm/functions/fnc_setSupplyCount.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

29 lines
769 B
Plaintext

#include "..\script_component.hpp"
/*
* 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
*/
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];