QBCore
Disabling the QBCore Ambulance Job Default Death Screen
To remove or disable the death screen in the QBCore Ambulance Job, make adjustments to certain functions in client/dead.lua. The following instructions guide you through commenting out lines responsible for the visual effects and camera controls associated with the death screen.
It is not recommended to use the Death Animation from Cloud Deathscreen if you're using QBCore. Instead, use the death animation provided by qb-ambulancejob.
Step 1: Modify gameEventTriggered Event
gameEventTriggered EventLocate the gameEventTriggered event handler and comment out the lines related to the death screen timer.
Original Code:
AddEventHandler('gameEventTriggered', function(event, data)
if event == 'CEventNetworkEntityDamage' then
local victim, attacker, victimDied, weapon = data[1], data[2], data[4], data[7]
if not IsEntityAPed(victim) then return end
if victimDied and NetworkGetPlayerIndexFromPed(victim) == PlayerId() and IsEntityDead(PlayerPedId()) then
if not InLaststand then
SetLaststand(true)
elseif InLaststand and not isDead then
SetLaststand(false)
local playerid = NetworkGetPlayerIndexFromPed(victim)
local playerName = GetPlayerName(playerid) .. ' ' .. '(' .. GetPlayerServerId(playerid) .. ')' or Lang:t('info.self_death')
local killerId = NetworkGetPlayerIndexFromPed(attacker)
local killerName = GetPlayerName(killerId) .. ' ' .. '(' .. GetPlayerServerId(killerId) .. ')' or Lang:t('info.self_death')
local weaponLabel = (QBCore.Shared.Weapons and QBCore.Shared.Weapons[weapon] and QBCore.Shared.Weapons[weapon].label) or 'Unknown'
local weaponName = (QBCore.Shared.Weapons and QBCore.Shared.Weapons[weapon] and QBCore.Shared.Weapons[weapon].name) or 'Unknown'
TriggerServerEvent('qb-log:server:CreateLog', 'death', Lang:t('logs.death_log_title', { playername = playerName, playerid = GetPlayerServerId(playerid) }), 'red', Lang:t('logs.death_log_message', { killername = killerName, playername = playerName, weaponlabel = weaponLabel, weaponname = weaponName }))
deathTime = Config.DeathTime
OnDeath()
DeathTimer()
end
end
end
end)Updated Code:
Step 2: Modify Main Thread
Locate the thread below and comment out the lines related to the death screen timer.
Original Code:
Updated Code:
Last updated