mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-30 22:01:37 +00:00
Commented out distance calculating until it gets fixed
This commit is contained in:
+11
-8
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user