Antibiotics combining

Vanilla development commit:

0602d29530
This commit is contained in:
ebaydayz
2016-07-23 15:03:49 -04:00
parent 34f9f97aa3
commit 8ed5a9c7a9
4 changed files with 32 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
private ["_total", "_full", "_remain", "_amount"];
_total = 0;
{
if(configName inheritsFrom (configfile >> "CfgMagazines" >> _x) == "ItemAntibiotic") then {
_amount = getNumber(configFile >> "CfgMagazines" >> _x >> "medical" >> "amount");
if(_amount > 0) then {
_total = _total + _amount;
player removeMagazine _x;
};
};
} count (magazines player);
_full = floor(_total / 6);
_remain = _total % 6;
for "_i" from 1 to _full do
{
player addMagazine "ItemAntibiotic6";
};
if(_remain > 0 ) then {
player addMagazine "ItemAntibiotic" + str(_remain);
};