diff options
| author | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:57:23 +0300 |
|---|---|---|
| committer | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:57:23 +0300 |
| commit | 3533c3aa9393fc6350178b196c813dc636ec9cf6 (patch) | |
| tree | 2f96a879c3935dea18e73410926b03c7eef1a751 /Client/Functions/Client_UIAddMagazine.sqf | |
| download | a2wf_isladuala-3533c3aa9393fc6350178b196c813dc636ec9cf6.tar.gz a2wf_isladuala-3533c3aa9393fc6350178b196c813dc636ec9cf6.tar.bz2 a2wf_isladuala-3533c3aa9393fc6350178b196c813dc636ec9cf6.zip | |
init
Diffstat (limited to '')
| -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 |
