mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
fix(esx_banking/client): cant open if player death
add 'esx:onPlayerDeath' event
This commit is contained in:
@@ -20,7 +20,7 @@ local playerLoaded, uiActive, inMenu = false, false, false
|
|||||||
data.ped = PlayerPedId()
|
data.ped = PlayerPedId()
|
||||||
bankPoints, atmPoints, markerPoints = {}, {}, {}
|
bankPoints, atmPoints, markerPoints = {}, {}, {}
|
||||||
|
|
||||||
if IsPedOnFoot(data.ped) and not inMenu then
|
if (IsPedOnFoot(data.ped) and not ESX.PlayerData.dead) and not inMenu then
|
||||||
for i = 1, #Config.AtmModels do
|
for i = 1, #Config.AtmModels do
|
||||||
local atm = GetClosestObjectOfType(data.coord.x, data.coord.y, data.coord.z, 0.7, Config.AtmModels[i], false, false, false)
|
local atm = GetClosestObjectOfType(data.coord.x, data.coord.y, data.coord.z, 0.7, Config.AtmModels[i], false, false, false)
|
||||||
if atm ~= 0 then
|
if atm ~= 0 then
|
||||||
@@ -221,6 +221,8 @@ end)
|
|||||||
if uiActive then BANK:TextUi(false) end
|
if uiActive then BANK:TextUi(false) end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
RegisterNetEvent('esx:onPlayerDeath', function() BANK:TextUi(false) end)
|
||||||
|
|
||||||
-- Nui Callbacks
|
-- Nui Callbacks
|
||||||
RegisterNUICallback('close', function(data, cb)
|
RegisterNUICallback('close', function(data, cb)
|
||||||
BANK:HandleUi(false)
|
BANK:HandleUi(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user