No more respawn for no reason

This commit is contained in:
MarioRogue
2018-06-09 23:27:44 +03:00
committed by GitHub
parent bb2171b4f0
commit 784aa4e1df
+24 -20
View File
@@ -58,29 +58,33 @@ AddEventHandler('esx_ambulancejob:heal', function(_type)
end) end)
function StartRespawnToHospitalMenuTimer() function StartRespawnToHospitalMenuTimer()
ESX.SetTimeout(Config.MenuRespawnToHospitalDelay, function() ESX.SetTimeout(Config.MenuRespawnToHospitalDelay, function()
ESX.UI.Menu.Open( if IsDead then
'default', GetCurrentResourceName(), 'respawn_hospital', ESX.UI.Menu.Open(
{ 'default', GetCurrentResourceName(), 'respawn_hospital',
title = _U('respawn_at_hospital'), {
align = 'top-left', title = _U('respawn_at_hospital'),
elements = { align = 'bottom-right',
{label = _U('no'), value = 'no'}, elements = {
{label = _U('yes'), value = 'yes'} {label = _U('no'), value = 'no'},
} {label = _U('yes'), value = 'yes'}
}, function(data, menu) }
if data.current.value == 'yes' then }, function(data, menu)
RemoveItemsAfterRPDeath() if data.current.value == 'yes' then
end RemoveItemsAfterRPDeath()
menu.close() end
end) menu.close()
end) end)
end
end)
end end
function StartRespawnTimer() function StartRespawnTimer()
ESX.SetTimeout(Config.RespawnDelayAfterRPDeath, function() ESX.SetTimeout(Config.RespawnDelayAfterRPDeath, function()
RemoveItemsAfterRPDeath() if IsDead then
end) RemoveItemsAfterRPDeath()
end
end)
end end
function StartDistressSignal() function StartDistressSignal()