From 628d33984d9228f1781d13a65fbb80f35facc899 Mon Sep 17 00:00:00 2001 From: hybrid Date: Thu, 11 Jun 2026 19:55:24 +0300 Subject: init --- Client/Functions/Client_UIAddMagazine.sqf | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Client/Functions/Client_UIAddMagazine.sqf (limited to 'Client/Functions/Client_UIAddMagazine.sqf') diff --git a/Client/Functions/Client_UIAddMagazine.sqf b/Client/Functions/Client_UIAddMagazine.sqf new file mode 100644 index 0000000..509c515 --- /dev/null +++ b/Client/Functions/Client_UIAddMagazine.sqf @@ -0,0 +1,35 @@ +private ["_get","_limit","_newMagSpace","_newMagSideInv","_mag","_magazines","_size"]; +_magazines = _this select 0; +_mag = _this select 1; +_size = 0; +_limit = 12; + +_get = _mag Call GetNamespace; +_newMagSpace = _get select QUERYGEARSPACE; +_newMagSideInv = _get select QUERYGEARHANDGUNPOOL; +_limit = if (_newMagSideInv) then {8} else {12}; + +if (_newMagSideInv) then { + { + _get = _x Call GetNamespace; + + if !(isNil '_get') then { + if (_get select QUERYGEARHANDGUNPOOL) then { + _size = _size + (_get select QUERYGEARSPACE); + }; + }; + } forEach _magazines; +} else { + { + _get = _x Call GetNamespace; + + if !(isNil '_get') then { + if !(_get select QUERYGEARHANDGUNPOOL) then { + _size = _size + (_get select QUERYGEARSPACE); + }; + }; + } forEach _magazines; +}; + +if (_size + _newMagSpace <= _limit) then {_magazines = _magazines + [_mag]}; +_magazines \ No newline at end of file -- cgit v1.3.1