The error
The code, I added the line numbers
Code:
13:30:39 "DayZ Epoch: PRELOAD Functions\init [[<No group>:0 (FunctionsManager)],any]"
13:30:39 "DayZ Epoch: MPframework inited"
13:30:39 Error in expression <nd (((_itemChances select _l) select 1) * 100);
for "_k" from 0 to (_weight - 1)>
13:30:39 Error position: <* 100);
for "_k" from 0 to (_weight - 1)>
13:30:39 Error *: Type String, expected Number
13:30:39 File z\addons\dayz_code\init\loot_init.sqf, line 85
The code, I added the line numbers
Code:
78for "_i" from 0 to ((count (_config)) - 1) do {
79 _classname = configName (_config select _i);
80 _itemChances = getArray (_config select _i);
81 _weighted = [];
82 _j = 0;
83 for "_l" from 0 to ((count _itemChances) - 1) do
84 {
85 _weight = round (((_itemChances select _l) 86select 1) * 100);
87 for "_k" from 0 to (_weight - 1) do
88 {
89 _weighted set [_j + _k, _l];
90 //_items set [count _items, 91((_itemChances select _l) select 0)];
92 };
93 _j = _j + _weight;
94 };
95 dayz_CLBase set [count dayz_CLBase, 96_classname];
97 dayz_CLChances set [count dayz_CLChances, 98_weighted];
99};