Search times for the ** function RemoveItemsAfterRPDeath () ** in the client Lua and compare it with mine then it should work. If you die with me you spawn in the MD after you die
function RemoveItemsAfterRPDeath()
TriggerServerEvent('esx_ambulancejob:setDeathStatus', false)
Citizen.CreateThread(function()
DoScreenFadeOut(800)
while not IsScreenFadedOut() do
Citizen.Wait(10)
end
ESX.TriggerServerCallback('esx_ambulancejob:removeItemsAfterRPDeath', function()
local formattedCoords = {
x = Config.RespawnPoint.coords.x,
y = Config.RespawnPoint.coords.y,
z = Config.RespawnPoint.coords.z
}
ESX.SetPlayerData('lastPosition', formattedCoords)
ESX.SetPlayerData('loadout', {})
TriggerServerEvent('esx:updateLastPosition', formattedCoords)
RespawnPed(PlayerPedId(), formattedCoords, Config.RespawnPoint.heading)
StopScreenEffect('DeathFailOut')
DoScreenFadeIn(800)
end)
end)
end
1 Like