Skip to content

Commit

Permalink
Merge pull request #1592 from Kenshiin13/fix-death
Browse files Browse the repository at this point in the history
fix(es_extended/client/modules/death): fix death thread on first spawn
  • Loading branch information
Kenshiin13 authored Jan 10, 2025
2 parents e0d9b2b + c744cf9 commit 3e58606
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions [core]/es_extended/client/modules/death.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ end

AddEventHandler("esx:onPlayerSpawn", function()
Citizen.CreateThreadNow(function()
while not ESX.PlayerLoaded do Wait(0) end

while ESX.PlayerLoaded and not ESX.PlayerData.dead do
if DoesEntityExist(ESX.PlayerData.ped) and (IsPedDeadOrDying(ESX.PlayerData.ped, true) or IsPedFatallyInjured(ESX.PlayerData.ped)) then
Death:Died()
Expand Down

0 comments on commit 3e58606

Please sign in to comment.