Fix (es_extended): player death event

when player drop from falling and die function not active
This commit is contained in:
kdxr
2022-11-04 15:15:37 +07:00
committed by GitHub
parent 52c70c6264
commit ebc47b714b
+1 -1
View File
@@ -4,7 +4,7 @@ AddEventHandler('gameEventTriggered', function(event, data)
if not IsPedAPlayer(victim) then return end
local player = PlayerId()
local playerPed = PlayerPedId()
if victimDied and NetworkGetPlayerIndexFromPed(victim) == player and IsPedDeadOrDying(victim, true) then
if victimDied and NetworkGetPlayerIndexFromPed(victim) == player and (IsPedDeadOrDying(victim, true) or IsPedFatallyInjured(victim)) then
local killerEntity, deathCause = GetPedSourceOfDeath(playerPed), GetPedCauseOfDeath(playerPed)
local killerClientId = NetworkGetPlayerIndexFromPed(killerEntity)
if killerEntity ~= playerPed and killerClientId and NetworkIsPlayerActive(killerClientId) then