mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-17 05:56:01 +01:00
tweak(death): damage event for ambulance
This commit is contained in:
@@ -29,18 +29,13 @@ AddEventHandler("gameEventTriggered", function(name, args)
|
|||||||
local victim = args[1]
|
local victim = args[1]
|
||||||
if not IsPedAPlayer(victim) or NetworkGetPlayerIndexFromPed(victim) ~= cache.playerId then return end
|
if not IsPedAPlayer(victim) or NetworkGetPlayerIndexFromPed(victim) ~= cache.playerId then return end
|
||||||
|
|
||||||
if not IsPedDeadOrDying(victim, true) then
|
local hit, bone = GetPedLastDamageBone(victim)
|
||||||
Wait(100)
|
if hit and usingAmbulance then
|
||||||
local hit, bone = GetPedLastDamageBone(victim)
|
local damageWeapon = ambulance:getLastDamagingWeapon(victim)
|
||||||
local alive = GetEntityHealth(victim) >= 100
|
ambulance:updateBodyDamage(bone, damageWeapon)
|
||||||
|
|
||||||
if hit and usingAmbulance and alive then
|
|
||||||
local damageWeapon = ambulance:getLastDamagingWeapon(victim)
|
|
||||||
return damageWeapon and ambulance:updateBodyDamage(bone, damageWeapon)
|
|
||||||
end
|
|
||||||
|
|
||||||
return not alive and PlayerEliminated(GetPedCauseOfDeath(cache.ped))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if not IsPedDeadOrDying(victim, true) or GetEntityHealth(victim) > 100 then return end
|
||||||
|
|
||||||
local killerEntity, deathCause = GetPedSourceOfDeath(cache.ped), GetPedCauseOfDeath(cache.ped)
|
local killerEntity, deathCause = GetPedSourceOfDeath(cache.ped), GetPedCauseOfDeath(cache.ped)
|
||||||
local killerClientId = NetworkGetPlayerIndexFromPed(killerEntity)
|
local killerClientId = NetworkGetPlayerIndexFromPed(killerEntity)
|
||||||
|
|||||||
Reference in New Issue
Block a user