fix(esx_banking/client): cant open if player death

add 'esx:onPlayerDeath' event
This commit is contained in:
Csoki
2023-01-16 13:38:55 +01:00
parent 618eafc9a1
commit b7e5351fcb
+3 -1
View File
@@ -20,7 +20,7 @@ local playerLoaded, uiActive, inMenu = false, false, false
data.ped = PlayerPedId()
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
local atm = GetClosestObjectOfType(data.coord.x, data.coord.y, data.coord.z, 0.7, Config.AtmModels[i], false, false, false)
if atm ~= 0 then
@@ -221,6 +221,8 @@ end)
if uiActive then BANK:TextUi(false) end
end)
RegisterNetEvent('esx:onPlayerDeath', function() BANK:TextUi(false) end)
-- Nui Callbacks
RegisterNUICallback('close', function(data, cb)
BANK:HandleUi(false)