From c005c1b28be2adfe16451ce2b3240fb69917f34b Mon Sep 17 00:00:00 2001 From: Andyyy7666 <86536434+Andyyy7666@users.noreply.github.com> Date: Mon, 12 Feb 2024 23:28:18 +0100 Subject: [PATCH] tweak(client/death): player death checks --- client/death.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/death.lua b/client/death.lua index 991ff06..a673c87 100644 --- a/client/death.lua +++ b/client/death.lua @@ -30,12 +30,16 @@ AddEventHandler("gameEventTriggered", function(name, args) if not IsPedAPlayer(victim) or NetworkGetPlayerIndexFromPed(victim) ~= cache.playerId then return end if not IsPedDeadOrDying(victim, true) then + Wait(100) local hit, bone = GetPedLastDamageBone(victim) - if hit and usingAmbulance then + local alive = GetEntityHealth(victim) >= 100 + + if hit and usingAmbulance and alive then local damageWeapon = ambulance:getLastDamagingWeapon(victim) return damageWeapon and ambulance:updateBodyDamage(bone, damageWeapon) end - return + + return not alive and PlayerEliminated(GetPedCauseOfDeath(cache.ped)) end local killerEntity, deathCause = GetPedSourceOfDeath(cache.ped), GetPedCauseOfDeath(cache.ped)