mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-18 14:12:57 +03:00
0.1
This commit is contained in:
55
dayz_code/actions/player_countmagazines.sqf
Normal file
55
dayz_code/actions/player_countmagazines.sqf
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
count player magazines with ammo count
|
||||
value = call player_countmagazines;
|
||||
return all player magazines with ammo count
|
||||
*/
|
||||
private ["_dialog","_control","_magazineArray","_item","_val","_max","_created"];
|
||||
disableSerialization;
|
||||
disableUserInput true;
|
||||
_dialog = findDisplay 106;
|
||||
_created = false;
|
||||
if ( isNull _dialog ) then {
|
||||
startLoadingScreen [""];
|
||||
createGearDialog [player, "RscDisplayGear"];
|
||||
_dialog = findDisplay 106;
|
||||
_created = true;
|
||||
};
|
||||
|
||||
_magazineArray = [];
|
||||
for "_i" from 109 to 120 do
|
||||
{
|
||||
_control = _dialog displayCtrl _i;
|
||||
_item = gearSlotData _control;
|
||||
_val = gearSlotAmmoCount _control;
|
||||
_max = getNumber (configFile >> "CfgMagazines" >> _item >> "count");
|
||||
if (_item != "") then {
|
||||
if (_val != _max) then {
|
||||
_magazineArray set [count _magazineArray,[_item,_val]];
|
||||
} else {
|
||||
_magazineArray set [count _magazineArray,_item];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
for "_i" from 122 to 129 do
|
||||
{
|
||||
_control = _dialog displayCtrl _i;
|
||||
_item = gearSlotData _control;
|
||||
_val = gearSlotAmmoCount _control;
|
||||
_max = getNumber (configFile >> "CfgMagazines" >> _item >> "count");
|
||||
if (_item != "") then {
|
||||
if (_val != _max) then {
|
||||
_magazineArray set [count _magazineArray,[_item,_val]];
|
||||
} else {
|
||||
_magazineArray set [count _magazineArray,_item];
|
||||
};
|
||||
};
|
||||
};
|
||||
if ( _created ) then {
|
||||
closeDialog 0;
|
||||
endLoadingScreen;
|
||||
};
|
||||
disableUserInput false;
|
||||
dayz_Magazines=_magazineArray;
|
||||
_magazineArray
|
||||
Reference in New Issue
Block a user