Epoch/Sources/epoch_server/compile/epoch_server/EPOCH_weightedArray.sqf
vbawol eaf23d4e31 0.3.9.0 b552
zombie fixes
removed armed vtol
prices for APEX vehicles
message when NVG disabed due to lack of energy
2016-06-30 17:43:28 -05:00

42 lines
1.7 KiB
Plaintext

/*
Author: Aaron Clark - EpochMod.com
Contributors:
Description:
Uses Epoch server extension to perform various functions like: kick, ban, shutdown, message, unlock/lock
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_server/EPOCH_weightedArray.sqf
*/
private["_return","_lootTableArray","_weightedArray"];
params ["_keyName","_configName","_arrayName"];
_return = missionNamespace getVariable[format["EPOCH_LT_%1_%2_%3",_configName,_keyName,_arrayName],[]];
if(_return isEqualTo[]) then {
_lootTableArray = [];
_weightedArray = [];
{
if(_x isEqualType []) then {
_x params ["_tname","_tqty"];
if (!(_tname isEqualTo "Zombie") || (_tname isEqualTo "Zombie") && EPOCH_mod_Ryanzombies_Enabled) then {
_lootTableArray pushBack _tname;
for "_i" from 1 to _tqty do {
_weightedArray pushBack _forEachIndex;
};
};
} else {
if (!(_x isEqualTo "Zombie") || (_x isEqualTo "Zombie") && EPOCH_mod_Ryanzombies_Enabled) then {
_lootTableArray pushBack _x;
_weightedArray pushBack _forEachIndex;
};
};
}forEach getArray(configFile >> _configName >> _keyName >> _arrayName);
_return = [_lootTableArray,_weightedArray];
missionNamespace setVariable[format["EPOCH_LT_%1_%2_%3",_configName,_keyName,_arrayName],_return];
diag_log format["EPOCH_LT_%1_%2_%3 = %4",_configName,_keyName,_arrayName,_return];
};
_return