diff --git a/[esx_addons]/esx_banking/client/main.lua b/[esx_addons]/esx_banking/client/main.lua index bcaeb811..e88b622b 100644 --- a/[esx_addons]/esx_banking/client/main.lua +++ b/[esx_addons]/esx_banking/client/main.lua @@ -107,9 +107,9 @@ local function StartThread() while PlayerLoaded do _PlayerPedId = PlayerPedId() _GetEntityCoords = GetEntityCoords(_PlayerPedId) + local closestBank = {} if IsPedOnFoot(PlayerPedId()) then - local closestBank = {} for i = 1, #Config.AtmModels do local atm = GetClosestObjectOfType(_GetEntityCoords, 8.0, Config.AtmModels[i], false) @@ -151,6 +151,9 @@ local function StartThread() isInMarker = false ESX.HideUI() end + elseif not next(closestBank) and isInMarker then + isInMarker = false + ESX.HideUI() end end @@ -247,6 +250,7 @@ end) AddEventHandler('onResourceStop', function(resource) if resource ~= GetCurrentResourceName() then return end RemoveBlips() + ESX.HideUI() if isInMenu then CloseUi() end