Favbar added: Banned items list and reset favbar on every login

This commit is contained in:
Raymix 2017-08-01 21:25:31 +01:00
parent 80329a9b16
commit 2f5fe0f149
2 changed files with 12 additions and 1 deletions

View File

@ -20,6 +20,12 @@ params ["_action","_idx","_bidx","_mod"];
switch _action do { switch _action do {
case "load": case "load":
{ {
if (EPOCH_fav_resetOnLogin) then {
profileNamespace setVariable ["rmx_var_favBar_MNone",nil];
profileNamespace setVariable ["rmx_var_favBar_MCtrl",nil];
profileNamespace setVariable ["rmx_var_favBar_MShift",nil];
profileNamespace setVariable ["rmx_var_favBar_MAlt",nil];
};
rmx_var_favBar_MNone = profileNamespace getVariable ["rmx_var_favBar_MNone",["","","","",""]]; rmx_var_favBar_MNone = profileNamespace getVariable ["rmx_var_favBar_MNone",["","","","",""]];
rmx_var_favBar_MCtrl = profileNamespace getVariable ["rmx_var_favBar_MCtrl",["","","","",""]]; rmx_var_favBar_MCtrl = profileNamespace getVariable ["rmx_var_favBar_MCtrl",["","","","",""]];
rmx_var_favBar_MShift = profileNamespace getVariable ["rmx_var_favBar_MShift",["","","","",""]]; rmx_var_favBar_MShift = profileNamespace getVariable ["rmx_var_favBar_MShift",["","","","",""]];
@ -52,6 +58,7 @@ switch _action do {
}; };
case "add": case "add":
{ {
if (rmx_var_favBar_Item in EPOCH_fav_BannedItems) exitWith {"Item is not allowed in favorites!" call epoch_message; false};
if (rmx_var_favBar_Item in rmx_var_favBar_current) exitWith {"Item already exists in favorites!" call epoch_message; false}; //if duplicate if (rmx_var_favBar_Item in rmx_var_favBar_current) exitWith {"Item already exists in favorites!" call epoch_message; false}; //if duplicate
_type = (rmx_var_favBar_Item call BIS_fnc_itemType) select 1; _type = (rmx_var_favBar_Item call BIS_fnc_itemType) select 1;

View File

@ -70,6 +70,10 @@ EPOCH_fav_enableFavoriteBar = true;
EPOCH_fav_FastWeaponSwitching = false; EPOCH_fav_FastWeaponSwitching = false;
//If enabled and inventory full, equipped weapon will be dropped on ground in favor for the new selected weapon, otherwise action will fail with message and weapon will not be equipped //If enabled and inventory full, equipped weapon will be dropped on ground in favor for the new selected weapon, otherwise action will fail with message and weapon will not be equipped
EPOCH_fav_DropIfOverflow = false; EPOCH_fav_DropIfOverflow = false;
//Items that users are not allowed to pin
EPOCH_fav_BannedItems = ["FAK"]; //add items that can be abused here
//Reset all favorite items on every login (players will be required to re-add everything again).
EPOCH_fav_resetOnLogin = true;
["EPOCH_onEachFrame", "onEachFrame", EPOCH_onEachFrame] call BIS_fnc_addStackedEventHandler; ["EPOCH_onEachFrame", "onEachFrame", EPOCH_onEachFrame] call BIS_fnc_addStackedEventHandler;