mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 02:08:55 +00:00
Don't let the dead access the F7 menu
This commit is contained in:
+13
-4
@@ -10,9 +10,10 @@ local Keys = {
|
||||
["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118
|
||||
}
|
||||
|
||||
ESX = nil
|
||||
local GUI = {}
|
||||
GUI.Time = 0
|
||||
ESX = nil
|
||||
local GUI = {}
|
||||
local isDead = false
|
||||
GUI.Time = 0
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
while ESX == nil do
|
||||
@@ -64,9 +65,17 @@ end
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
Citizen.Wait(25)
|
||||
if IsControlPressed(0, Keys["F7"]) and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'billing') and (GetGameTimer() - GUI.Time) > 150 then
|
||||
if IsControlPressed(0, Keys["F7"]) and not isDead and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'billing') and (GetGameTimer() - GUI.Time) > 150 then
|
||||
ShowBillsMenu()
|
||||
GUI.Time = GetGameTimer()
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
AddEventHandler('esx:onPlayerDeath', function()
|
||||
isDead = true
|
||||
end)
|
||||
|
||||
AddEventHandler('playerSpawned', function(spawn)
|
||||
isDead = false
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user