This document explains the full installation proccess and config.lua file used by the resource. Every section is described in detail so server owners can easily customize the DeathScreen their needs.
Step 1: Framework detection
Go to pinkFrog_deathScreen/shared/config.lua and select your framework: ESX / QBOX / QBCore
Step 2: Configure your ambulanceJob Script
Guide for: esx_ambulancejob
Option 1: Use attached files and replace in script
Replace this file with esx_ambulancejob/client/main.lua
RegisterNetEvent('esx_ambulancejob:revive')
AddEventHandler('esx_ambulancejob:revive', function()
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)
TriggerServerEvent('esx_ambulancejob:setDeathStatus', false)
DoScreenFadeOut(800)
while not IsScreenFadedOut() do
Wait(50)
end
exports['pinkFrog_deathScreen']:HardReset() -- our exported function to reset death screen immediately
local formattedCoords = {x = ESX.Math.Round(coords.x, 1), y = ESX.Math.Round(coords.y, 1), z = ESX.Math.Round(coords.z, 1)}
RespawnPed(playerPed, formattedCoords, 0.0)
isDead = false
ClearTimecycleModifier()
SetPedMotionBlur(playerPed, false)
ClearExtraTimecycleModifier()
EndDeathCam()
DoScreenFadeIn(800)
end)
function revivePlayer(closestPlayer)
isBusy = true
ESX.TriggerServerCallback('esx_ambulancejob:getItemAmount', function(quantity)
if quantity > 0 then
local closestPlayerPed = GetPlayerPed(closestPlayer)
local isInDeadAnim = IsEntityPlayingAnim(closestPlayerPed, "missarmenian2", "drunk_loop", 3) -- here code to check if player is in downed animation
local isInCrawlingAnim = IsEntityPlayingAnim(closestPlayerPed, "missheist_agency3aig_19", "ground_call_help", 3)
if isInDeadAnim or isInCrawlingAnim or IsPedDeadOrDying(closestPlayerPed, 1) then
local playerPed = PlayerPedId()
local lib, anim = 'mini@cpr@char_a@cpr_str', 'cpr_pumpchest'
ESX.ShowNotification(TranslateCap('revive_inprogress'))
for i = 1, 15 do
Wait(900)
ESX.Streaming.RequestAnimDict(lib, function()
TaskPlayAnim(playerPed, lib, anim, 8.0, -8.0, -1, 0, 0.0, false, false, false)
RemoveAnimDict(lib)
end)
end
TriggerServerEvent('esx_ambulancejob:removeItem', 'medikit')
TriggerServerEvent('esx_ambulancejob:revive', GetPlayerServerId(closestPlayer))
else
ESX.ShowNotification(TranslateCap('player_not_unconscious'))
end
else
ESX.ShowNotification(TranslateCap('not_enough_medikit'))
end
isBusy = false
end, 'medikit')
end