mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 17:28:53 +00:00
Don't show register menu if dead
This commit is contained in:
+13
-1
@@ -2,6 +2,8 @@ local guiEnabled = false
|
||||
local myIdentity = {}
|
||||
local myIdentifiers = {}
|
||||
local hasIdentity = false
|
||||
local isDead = false
|
||||
|
||||
ESX = nil
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
@@ -11,6 +13,14 @@ Citizen.CreateThread(function()
|
||||
end
|
||||
end)
|
||||
|
||||
AddEventHandler('esx:onPlayerDeath', function(data)
|
||||
isDead = true
|
||||
end)
|
||||
|
||||
AddEventHandler('playerSpawned', function(spawn)
|
||||
isDead = false
|
||||
end)
|
||||
|
||||
function EnableGui(state)
|
||||
SetNuiFocus(state, state)
|
||||
guiEnabled = state
|
||||
@@ -23,7 +33,9 @@ end
|
||||
|
||||
RegisterNetEvent('esx_identity:showRegisterIdentity')
|
||||
AddEventHandler('esx_identity:showRegisterIdentity', function()
|
||||
EnableGui(true)
|
||||
if not isDead then
|
||||
EnableGui(true)
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx_identity:identityCheck')
|
||||
|
||||
Reference in New Issue
Block a user