From 33267a20f6ee01af6745a2619fc69e1eb6db1c0a Mon Sep 17 00:00:00 2001 From: "[VB]AWOL" Date: Thu, 21 Nov 2013 11:07:44 -0600 Subject: [PATCH] cfgloot support for weapons pt2 --- SQF/dayz_code/compile/spawn_loot_small.sqf | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/SQF/dayz_code/compile/spawn_loot_small.sqf b/SQF/dayz_code/compile/spawn_loot_small.sqf index 7f203d27f..048c51a5a 100644 --- a/SQF/dayz_code/compile/spawn_loot_small.sqf +++ b/SQF/dayz_code/compile/spawn_loot_small.sqf @@ -40,6 +40,24 @@ switch (_iClass) do _canType = _itemTypes select _index; _item addMagazineCargoGlobal [_canType,1]; }; + case "cfglootweapon": + { + //Item is sigle, add 1 item from cfgloot + _item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"]; + + _itemTypes = [] + ((getArray (configFile >> "cfgLoot" >> _iItem)) select 0); + _index = dayz_CLBase find _iItem; + _weights = dayz_CLChances select _index; + _cntWeights = count _weights; + + _index = floor(random _cntWeights); + _index = _weights select _index; + _iItem = _itemTypes select _index; + + _item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"]; + _item addWeaponCargoGlobal [_iItem,1]; + + }; case "weapon": { _item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];