mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
No more respawn for no reason
This commit is contained in:
+24
-20
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user