Consolidate ItemKeyXXX/Colors to arrays.

Tidies up scripts inside epoch and for script creators.
Moved z_at_buyItems to epoch_generateKey.
This commit is contained in:
oiad
2017-11-19 11:27:02 +13:00
parent 2f178d8978
commit 9b96ddd2c3
6 changed files with 16 additions and 18 deletions

View File

@@ -10,7 +10,7 @@
private ["_isKeyOK","_keyColor","_keyNumber","_keySelected"];
// First select key color
_keyColor = ["Green","Red","Blue","Yellow","Black"] call BIS_fnc_selectRandom;
_keyColor = DZE_keyColors call BIS_fnc_selectRandom;
// then select number from 1 - 2500
_keyNumber = (floor(random 2500)) + 1;

View File

@@ -4,7 +4,7 @@
Returns array: [["11148","1457"],["Black Key (2eb5)","Green Key (9c30)"],["ItemKeyBlack1148","ItemKeyGreen1457"]]
*/
private ["_temp_keys","_temp_keys_names","_key_colors","_ownerKeyId","_ownerKeyName","_items","_temp_keys_class"];
private ["_temp_keys","_temp_keys_names","_ownerKeyId","_ownerKeyName","_items","_temp_keys_class"];
_temp_keys = [];
_temp_keys_names = [];
@@ -16,10 +16,8 @@ if (!isNull dayz_myBackpack) then {
_items = _items + ((getWeaponCargo dayz_myBackpack) select 0);
};
_key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
{
if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in _key_colors) then {
if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in DZE_itemKeys) then {
_ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _x >> "keyid");
_ownerKeyName = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
_temp_keys_names set [count _temp_keys_names,_ownerKeyName];