mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
fix(esx_banking): remove ox_target from Code
This commit is contained in:
@@ -74,20 +74,6 @@ local function PedHandler(ids)
|
|||||||
SetPedCanRagdoll(npc, false)
|
SetPedCanRagdoll(npc, false)
|
||||||
SetEntityAsMissionEntity(npc, true, true)
|
SetEntityAsMissionEntity(npc, true, true)
|
||||||
SetEntityDynamic(npc, false)
|
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
|
Peds[id] = npc
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -105,9 +91,6 @@ local function PedHandler(ids)
|
|||||||
|
|
||||||
if del then
|
if del then
|
||||||
DeletePed(handle)
|
DeletePed(handle)
|
||||||
if Config.Target then
|
|
||||||
exports.ox_target:removeGlobalPed(handle, {TranslateCap('access_bank')})
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -117,9 +100,7 @@ end
|
|||||||
function OpenUi(atm)
|
function OpenUi(atm)
|
||||||
atm = atm or false
|
atm = atm or false
|
||||||
isInMenu = true
|
isInMenu = true
|
||||||
if not Config.Target then
|
ESX.HideUI()
|
||||||
ESX.HideUI()
|
|
||||||
end
|
|
||||||
ESX.TriggerServerCallback('esx_banking:getPlayerData', function(data)
|
ESX.TriggerServerCallback('esx_banking:getPlayerData', function(data)
|
||||||
SendNUIMessage({
|
SendNUIMessage({
|
||||||
showMenu = true,
|
showMenu = true,
|
||||||
@@ -154,7 +135,7 @@ local function CloseUi()
|
|||||||
showMenu = false
|
showMenu = false
|
||||||
})
|
})
|
||||||
|
|
||||||
if not Config.Target and (isInMarker or isInAtmMarker) then
|
if (isInMarker or isInAtmMarker) then
|
||||||
ESX.TextUI(TranslateCap('press_e_banking'))
|
ESX.TextUI(TranslateCap('press_e_banking'))
|
||||||
Listen4Key()
|
Listen4Key()
|
||||||
end
|
end
|
||||||
@@ -174,40 +155,6 @@ local function StartThread()
|
|||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
CreateBlips()
|
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
|
while PlayerLoaded do
|
||||||
_PlayerPedId = PlayerPedId()
|
_PlayerPedId = PlayerPedId()
|
||||||
_GetEntityCoords = GetEntityCoords(_PlayerPedId)
|
_GetEntityCoords = GetEntityCoords(_PlayerPedId)
|
||||||
@@ -225,7 +172,7 @@ local function StartThread()
|
|||||||
PedHandler(closestPed)
|
PedHandler(closestPed)
|
||||||
end
|
end
|
||||||
|
|
||||||
if not Config.Target and not isInMenu and IsPedOnFoot(PlayerPedId()) then
|
if not isInMenu and IsPedOnFoot(PlayerPedId()) then
|
||||||
local closestBank = {}
|
local closestBank = {}
|
||||||
|
|
||||||
for i = 1, #Config.AtmModels do
|
for i = 1, #Config.AtmModels do
|
||||||
|
|||||||
Reference in New Issue
Block a user