Skip to content

Commit d0d04ae

Browse files
committed
tweak(death): damage event for ambulance
1 parent c005c1b commit d0d04ae

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

client/death.lua

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,13 @@ AddEventHandler("gameEventTriggered", function(name, args)
2929
local victim = args[1]
3030
if not IsPedAPlayer(victim) or NetworkGetPlayerIndexFromPed(victim) ~= cache.playerId then return end
3131

32-
if not IsPedDeadOrDying(victim, true) then
33-
Wait(100)
34-
local hit, bone = GetPedLastDamageBone(victim)
35-
local alive = GetEntityHealth(victim) >= 100
36-
37-
if hit and usingAmbulance and alive then
38-
local damageWeapon = ambulance:getLastDamagingWeapon(victim)
39-
return damageWeapon and ambulance:updateBodyDamage(bone, damageWeapon)
40-
end
41-
42-
return not alive and PlayerEliminated(GetPedCauseOfDeath(cache.ped))
32+
local hit, bone = GetPedLastDamageBone(victim)
33+
if hit and usingAmbulance then
34+
local damageWeapon = ambulance:getLastDamagingWeapon(victim)
35+
ambulance:updateBodyDamage(bone, damageWeapon)
4336
end
37+
38+
if not IsPedDeadOrDying(victim, true) or GetEntityHealth(victim) > 100 then return end
4439

4540
local killerEntity, deathCause = GetPedSourceOfDeath(cache.ped), GetPedCauseOfDeath(cache.ped)
4641
local killerClientId = NetworkGetPlayerIndexFromPed(killerEntity)

0 commit comments

Comments
 (0)