From dd70d5261dc0553492b6a9487448619e99e5a223 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Sat, 4 Nov 2023 20:04:43 +0100 Subject: [PATCH 1/2] fix(ESX.UI): Close Opened Menus on Resource Stop --- client/functions.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/client/functions.lua b/client/functions.lua index a2e6ce6..f50f50f 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -1342,6 +1342,17 @@ AddEventHandler('esx:showHelpNotification', function(msg, thisFrame, beep, durat ESX.ShowHelpNotification(msg, thisFrame, beep, duration) end) +AddEventHandler('onResourceStop', function(resourceName) + for i = 1, #ESX.UI.Menu.Opened, 1 do + if ESX.UI.Menu.Opened[i] then + if ESX.UI.Menu.Opened[i].namespace == resourceName then + ESX.UI.Menu.Opened[i].close() + ESX.UI.Menu.Opened[i] = nil + end + end + end +end) + -- SetTimeout CreateThread(function() while true do From 98d5c51335af8b9837d6be940fcd27541b885420 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Sat, 4 Nov 2023 20:06:07 +0100 Subject: [PATCH 2/2] chore: Improved code formatting --- config.lua | 66 +++++++++++++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/config.lua b/config.lua index f0b786b..f20f7bc 100644 --- a/config.lua +++ b/config.lua @@ -13,48 +13,48 @@ Config.Accounts = { money = { label = _U('account_money'), round = true - } + }, } -Config.StartingAccountMoney = {bank = 50000} -Config.EnableSocietyPayouts = true -- pay from the society account that the player is employed at? Requirement: esx_society -Config.MaxWeight = 24 -- the max inventory weight without backpack -Config.PaycheckInterval = 7 * 60000 -- how often to recieve pay checks in milliseconds -Config.EnableDebug = false -- Use Debug options? -Config.EnableDefaultInventory = false -- Display the default Inventory ( F2 ) -Config.EnableWantedLevel = false -- Use Normal GTA wanted Level? -Config.EnablePVP = true -- Allow Player to player combat +Config.StartingAccountMoney = {bank = 50000} +Config.EnableSocietyPayouts = true -- pay from the society account that the player is employed at? Requirement: esx_society +Config.MaxWeight = 24 -- the max inventory weight without backpack +Config.PaycheckInterval = 7 * 60000 -- how often to recieve pay checks in milliseconds +Config.EnableDebug = false -- Use Debug options? +Config.EnableWantedLevel = false -- Use Normal GTA wanted Level? +Config.EnablePVP = true -- Allow Player to player combat Config.Multichar = true -- Enable support for esx_multicharacter Config.Identity = true -- Select a characters identity data before they have loaded in (this happens by default with multichar) Config.DistanceGive = 4.0 -- Max distance when giving items, weapons etc. Config.DisableHealthRegeneration = false -- Player will no longer regenerate health Config.DisableVehicleRewards = false -- Disables Player Recieving weapons from vehicles -Config.DisableNPCDrops = false -- stops NPCs from dropping weapons on death +Config.DisableNPCDrops = true -- stops NPCs from dropping weapons on death Config.DisableWeaponWheel = false -- Disables default weapon wheel Config.DisableAimAssist = false -- disables AIM assist (mainly on controllers) -Config.RemoveHudCommonents = { - [1] = false, --WANTED_STARS, - [2] = false, --WEAPON_ICON - [3] = false, --CASH - [4] = false, --MP_CASH - [5] = false, --MP_MESSAGE - [6] = false, --VEHICLE_NAME - [7] = false,-- AREA_NAME - [8] = false,-- VEHICLE_CLASS - [9] = false, --STREET_NAME - [10] = false, --HELP_TEXT - [11] = false, --FLOATING_HELP_TEXT_1 - [12] = false, --FLOATING_HELP_TEXT_2 - [13] = false, --CASH_CHANGE - [14] = false, --RETICLE - [15] = false, --SUBTITLE_TEXT - [16] = false, --RADIO_STATIONS - [17] = false, --SAVING_GAME, - [18] = false, --GAME_STREAM - [19] = false, --WEAPON_WHEEL - [20] = false, --WEAPON_WHEEL_STATS - [21] = false, --HUD_COMPONENTS - [22] = false, --HUD_WEAPONS +Config.DisableDisplayAmmo = false -- Disable ammunition display +Config.RemoveHudComponents = { + [1] = false, -- WANTED_STARS, + [2] = false, -- WEAPON_ICON + [3] = false, -- CASH + [4] = false, -- MP_CASH + [5] = false, -- MP_MESSAGE + [6] = false, -- VEHICLE_NAME + [7] = false, -- AREA_NAME + [8] = false, -- VEHICLE_CLASS + [9] = false, -- STREET_NAME + [10] = false, -- HELP_TEXT + [11] = false, -- FLOATING_HELP_TEXT_1 + [12] = false, -- FLOATING_HELP_TEXT_2 + [13] = false, -- CASH_CHANGE + [14] = false, -- RETICLE + [15] = false, -- SUBTITLE_TEXT + [16] = false, -- RADIO_STATIONS + [17] = false, -- SAVING_GAME, + [18] = false, -- GAME_STREAM + [19] = false, -- WEAPON_WHEEL + [20] = false, -- WEAPON_WHEEL_STATS + [21] = false, -- HUD_COMPONENTS + [22] = false, -- HUD_WEAPONS } Config.MaxAdminVehicles = true -- admin vehicles spawn with max vehcle settings