From 2b74213b19178a39fa1fd3661384d12eb6e78b57 Mon Sep 17 00:00:00 2001 From: RoadToSix <92928205+roadtosixx@users.noreply.github.com> Date: Tue, 18 Oct 2022 15:31:33 +0200 Subject: [PATCH 1/2] fix(esx_banking): remove Target config option --- [esx_addons]/esx_banking/config.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/[esx_addons]/esx_banking/config.lua b/[esx_addons]/esx_banking/config.lua index a76209c3..b6499468 100644 --- a/[esx_addons]/esx_banking/config.lua +++ b/[esx_addons]/esx_banking/config.lua @@ -1,7 +1,6 @@ Config = { Debug = false, DrawMarker = 10, - Target = false, -- ox_target (https://github.com/overextended/ox_target) Locale = 'en', EnablePeds = true, AtmModels = {`prop_fleeca_atm`, `prop_atm_01`, `prop_atm_02`, `prop_atm_03`}, From a9d3ec7ea8b1563eb11cee09c0a255a1cbd8a41c Mon Sep 17 00:00:00 2001 From: RoadToSix <92928205+roadtosixx@users.noreply.github.com> Date: Tue, 18 Oct 2022 15:31:49 +0200 Subject: [PATCH 2/2] fix(esx_banking): remove ox_target from Code --- [esx_addons]/esx_banking/client/main.lua | 59 ++---------------------- 1 file changed, 3 insertions(+), 56 deletions(-) diff --git a/[esx_addons]/esx_banking/client/main.lua b/[esx_addons]/esx_banking/client/main.lua index 4dcec7cd..2c60fe9f 100644 --- a/[esx_addons]/esx_banking/client/main.lua +++ b/[esx_addons]/esx_banking/client/main.lua @@ -74,20 +74,6 @@ local function PedHandler(ids) SetPedCanRagdoll(npc, false) SetEntityAsMissionEntity(npc, true, true) SetEntityDynamic(npc, false) - - if Config.Target then - exports.ox_target:addGlobalPed(npc, { - options = {{ - icon = "fas fa-money-bill-wave", - label = TranslateCap('access_bank'), - action = function() - OpenUi() - end - }}, - distance = 2 - }) - end - Peds[id] = npc end end @@ -105,9 +91,6 @@ local function PedHandler(ids) if del then DeletePed(handle) - if Config.Target then - exports.ox_target:removeGlobalPed(handle, {TranslateCap('access_bank')}) - end end end @@ -117,9 +100,7 @@ end function OpenUi(atm) atm = atm or false isInMenu = true - if not Config.Target then - ESX.HideUI() - end + ESX.HideUI() ESX.TriggerServerCallback('esx_banking:getPlayerData', function(data) SendNUIMessage({ showMenu = true, @@ -154,7 +135,7 @@ local function CloseUi() showMenu = false }) - if not Config.Target and (isInMarker or isInAtmMarker) then + if (isInMarker or isInAtmMarker) then ESX.TextUI(TranslateCap('press_e_banking')) Listen4Key() end @@ -174,40 +155,6 @@ local function StartThread() CreateThread(function() CreateBlips() - if Config.Target then - exports.ox_target:addModel(Config.AtmModels, { - options = {{ - icon = 'fas fa-credit-card', - label = TranslateCap('access_bank'), - action = function() - OpenUi(true) - end - }}, - distance = 1.5 - }) - if not Config.EnablePeds then - for i = 1, #Config.Banks do - local targetInfo = Config.Banks[i].Position - exports.ox_target:addBoxZone('openBank' .. i, targetInfo.xyz, 1.5, 1.5, { - name = 'openBank' .. i, - heading = targetInfo.w, - minZ = targetInfo.z - 1.0, - maxZ = targetInfo.z + 1.5, - debugPoly = Config.Debug - }, { - options = {{ - icon = 'fas fa-money-bill-wave', - label = TranslateCap('access_bank'), - action = function() - OpenUi() - end - }}, - distance = 2.0 - }) - end - end - end - while PlayerLoaded do _PlayerPedId = PlayerPedId() _GetEntityCoords = GetEntityCoords(_PlayerPedId) @@ -225,7 +172,7 @@ local function StartThread() PedHandler(closestPed) end - if not Config.Target and not isInMenu and IsPedOnFoot(PlayerPedId()) then + if not isInMenu and IsPedOnFoot(PlayerPedId()) then local closestBank = {} for i = 1, #Config.AtmModels do