Commented out distance calculating until it gets fixed

This commit is contained in:
ElPumpo
2018-07-15 13:37:03 +02:00
parent e7016c723c
commit 2dfff894e5
+11 -8
View File
@@ -104,9 +104,18 @@ AddEventHandler('baseevents:onPlayerKilled', function(killerPed, data)
deathCause = GetPedCauseOfDeath(playerPed)
})
if killerPed ~= -1 then -- if the killer isn't AI
if killerPed == -1 then -- player died by AI, we cannot provide as much info because of baseevents setting 'killerPed' to '-1'
table.insert(data, {
killed = false
})
else -- if the killer isn't AI
killerPed = GetPlayerPed(GetPlayerFromServerId(killerPed))
local killerCoords = GetEntityCoords(killerPed)
local distance = GetDistanceBetweenCoords(table.unpack(killerCoords), table.unpack(data.victimCoords), false)
--local distance = GetDistanceBetweenCoords(table.unpack(killerCoords), table.unpack(data.victimCoords), false)
local distance = 2
table.insert(data, {
killed = true,
@@ -115,12 +124,6 @@ AddEventHandler('baseevents:onPlayerKilled', function(killerPed, data)
distance = ESX.Round(distance)
})
else -- player died by AI, we cannot provide as much info because of baseevents setting 'killerPed' to '-1'
table.insert(data, {
killed = false
})
end
TriggerEvent('esx:onPlayerDeath', data)