refactor: Optimize death module

This commit is contained in:
MiddleSkillz
2021-05-06 02:21:31 -06:00
parent 7f4f4d14e0
commit 4cd90dc1d8
2 changed files with 16 additions and 12 deletions
+8 -10
View File
@@ -405,17 +405,15 @@ function StartServerSyncLoops()
end)
end
Citizen.CreateThread(function()
while Config.EnableDefaultInventory do
Citizen.Wait(9)
if IsControlJustReleased(0, 289) then
if IsInputDisabled(0) and not isDead and not ESX.UI.Menu.IsOpen('default', 'es_extended', 'inventory') then
ESX.ShowInventory()
end
if Config.EnableDefaultInventory then
RegisterCommand('showinv', function()
if not isDead and not ESX.UI.Menu.IsOpen('default', 'es_extended', 'inventory') then
ESX.ShowInventory()
end
end
end)
end)
RegisterKeyMapping('showinv', _U('keymap_showinventory'), 'keyboard', 'F2')
end
Citizen.CreateThread(function()
while true do