ESX
Disabling the ESX Ambulance Job Default Death Screen
Step 1: Add esx_ambulancejob:RespawnAtHospital Event
esx_ambulancejob:RespawnAtHospital EventRegisterNetEvent("esx_ambulancejob:RespawnAtHospital", RemoveItemsAfterRPDeath)Step 2: Modify esx:onPlayerSpawn Event
esx:onPlayerSpawn EventAddEventHandler('esx:onPlayerSpawn', function()
isDead = false
ClearTimecycleModifier()
SetPedMotionBlur(PlayerPedId(), false)
ClearExtraTimecycleModifier()
EndDeathCam()
if firstSpawn then
firstSpawn = false
if Config.SaveDeathStatus then
while not ESX.PlayerLoaded do
Wait(1000)
end
ESX.TriggerServerCallback('esx_ambulancejob:getDeathStatus', function(shouldDie)
if shouldDie then
Wait(1000)
SetEntityHealth(PlayerPedId(), 0)
end
end)
end
end
end)Step 3: Modify OnPlayerDeath Function
OnPlayerDeath FunctionStep 4: Modify StartDeathLoop Function
StartDeathLoop FunctionStep 5: Modify esx_ambulancejob:revive Event
esx_ambulancejob:revive EventLast updated