diff options
| author | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:53:22 +0300 |
|---|---|---|
| committer | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:53:22 +0300 |
| commit | c055d44dcdb87e8db49fb23e632fc086aa44cce6 (patch) | |
| tree | 7ac98d865915930bebc86b36b512a859c31538e5 /Client/Functions/Client_UIAddMagazine.sqf | |
| download | a2wf_zargabad-c055d44dcdb87e8db49fb23e632fc086aa44cce6.tar.gz a2wf_zargabad-c055d44dcdb87e8db49fb23e632fc086aa44cce6.tar.bz2 a2wf_zargabad-c055d44dcdb87e8db49fb23e632fc086aa44cce6.zip | |
init
Diffstat (limited to 'Client/Functions/Client_UIAddMagazine.sqf')
| -rw-r--r-- | Client/Functions/Client_UIAddMagazine.sqf | 35 |
1 files changed, 35 insertions, 0 deletions
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 |
