mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +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 myIdentity = {}
|
||||||
local myIdentifiers = {}
|
local myIdentifiers = {}
|
||||||
local hasIdentity = false
|
local hasIdentity = false
|
||||||
|
local isDead = false
|
||||||
|
|
||||||
ESX = nil
|
ESX = nil
|
||||||
|
|
||||||
Citizen.CreateThread(function()
|
Citizen.CreateThread(function()
|
||||||
@@ -11,6 +13,14 @@ Citizen.CreateThread(function()
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
AddEventHandler('esx:onPlayerDeath', function(data)
|
||||||
|
isDead = true
|
||||||
|
end)
|
||||||
|
|
||||||
|
AddEventHandler('playerSpawned', function(spawn)
|
||||||
|
isDead = false
|
||||||
|
end)
|
||||||
|
|
||||||
function EnableGui(state)
|
function EnableGui(state)
|
||||||
SetNuiFocus(state, state)
|
SetNuiFocus(state, state)
|
||||||
guiEnabled = state
|
guiEnabled = state
|
||||||
@@ -23,7 +33,9 @@ end
|
|||||||
|
|
||||||
RegisterNetEvent('esx_identity:showRegisterIdentity')
|
RegisterNetEvent('esx_identity:showRegisterIdentity')
|
||||||
AddEventHandler('esx_identity:showRegisterIdentity', function()
|
AddEventHandler('esx_identity:showRegisterIdentity', function()
|
||||||
EnableGui(true)
|
if not isDead then
|
||||||
|
EnableGui(true)
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
RegisterNetEvent('esx_identity:identityCheck')
|
RegisterNetEvent('esx_identity:identityCheck')
|
||||||
|
|||||||
Reference in New Issue
Block a user