Don't let the dead access the F7 menu

This commit is contained in:
ElPumpo
2018-04-15 23:23:41 +02:00
parent a0244e6980
commit b853ccb239
+13 -4
View File
@@ -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)