mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-17 05:56:01 +01:00
tweak(client/death): player death checks
This commit is contained in:
@@ -30,12 +30,16 @@ AddEventHandler("gameEventTriggered", function(name, args)
|
|||||||
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
|
if not IsPedDeadOrDying(victim, true) then
|
||||||
|
Wait(100)
|
||||||
local hit, bone = GetPedLastDamageBone(victim)
|
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)
|
local damageWeapon = ambulance:getLastDamagingWeapon(victim)
|
||||||
return damageWeapon and ambulance:updateBodyDamage(bone, damageWeapon)
|
return damageWeapon and ambulance:updateBodyDamage(bone, damageWeapon)
|
||||||
end
|
end
|
||||||
return
|
|
||||||
|
return not alive and PlayerEliminated(GetPedCauseOfDeath(cache.ped))
|
||||||
end
|
end
|
||||||
|
|
||||||
local killerEntity, deathCause = GetPedSourceOfDeath(cache.ped), GetPedCauseOfDeath(cache.ped)
|
local killerEntity, deathCause = GetPedSourceOfDeath(cache.ped), GetPedCauseOfDeath(cache.ped)
|
||||||
|
|||||||
Reference in New Issue
Block a user