Ambulance script setup
You only need to change one ambulance script: the one you use. Not sure which one you have? Look in your resources folder for one of the names below.
Each change only applies while gs-deathscreen is started. If you stop gs-deathscreen, your ambulance script's own screen comes back.
- ak47_ambulancejob
- wasabi_ambulance
- qbx_ambulancejob (Qbox)
- esx_death (ESX 1.16+)
- esx_ambulancejob (older ESX)
- qb-ambulancejob (QBCore)
The easiest one. Open ak47_ambulancejob/configs/_config.lua and set:
Config.DisableDeathScreen = true
gs-deathscreen reads ak47's config for its bleed-out time, hospital cost and distress command, so you don't need to copy them.
- Open
wasabi_ambulance/game/client/cl_customize.lua. - Find the line
function StartDeathTimer(). - Paste this right below it:
if GetResourceState('gs-deathscreen') == 'started' then
if not Config.DisableDeathAnimation then SetGameplayCamRelativeHeading(-360) end
return
end
Open qbx_ambulancejob/client/setdownedstate.lua and make 3 changes.
1. Find local doctorCount = 0 and paste this below it:
local customDeathScreen = GetResourceState('gs-deathscreen') == 'started'
AddEventHandler('onClientResourceStart', function(resource)
if resource == 'gs-deathscreen' then customDeathScreen = true end
end)
AddEventHandler('onClientResourceStop', function(resource)
if resource == 'gs-deathscreen' then customDeathScreen = false end
end)
2. Find local function handleLastStand() and paste this below it:
if customDeathScreen then return end
3. Find if not IsInHospitalBed then and replace it with:
if not IsInHospitalBed and not customDeathScreen then
Open esx_death/client/main.lua.
1. Find local function refreshUI() and paste this below it. Do the same below local function setCursor(enabled):
if GetResourceState('gs-deathscreen') == 'started' then return end
2. In the death loop, add not gsScreen and to the G and E key checks:
local gsScreen = GetResourceState('gs-deathscreen') == 'started'
if not gsScreen and IsDisabledControlJustReleased(0, 47) then
-- ...
if not gsScreen and IsDisabledControlPressed(0, 38) and early <= 0 and not pending then
Use this only if you don't have esx_death.
Open esx_ambulancejob/client/main.lua, find function StartDeathTimer(elapsed) and paste this below it:
if GetResourceState('gs-deathscreen') == 'started' then return end
Open qb-ambulancejob/client/dead.lua and qb-ambulancejob/client/laststand.lua.
Find the code that draws the RESPAWN IN / BLEEDING OUT text and the hold-E respawn, and put it inside:
if GetResourceState('gs-deathscreen') ~= 'started' then
-- the original code stays here
end
Using sv_stateBagStrictMode on Qbox
Strict mode works without changes for ak47, wasabi, ESX and QBCore. On Qbox, qbx_medical needs two small changes.
In qbx_medical/client/main.lua, inside SetDeathState, right after DeathState = deathState, add:
TriggerServerEvent('qbx_medical:server:syncDeathState', deathState)
In qbx_medical/server/main.lua, above AddStateBagChangeHandler(DEATH_STATE_STATE_BAG, ...), add:
local validDeathStates = {}
for _, state in pairs(sharedConfig.deathState) do validDeathStates[state] = true end
RegisterNetEvent('qbx_medical:server:syncDeathState', function(deathState)
local src = source
if not validDeathStates[deathState] or not exports.qbx_core:GetPlayer(src) then return end
local playerState = Player(src).state
if playerState[DEATH_STATE_STATE_BAG] ~= deathState then
playerState:set(DEATH_STATE_STATE_BAG, deathState, true)
end
end)