mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2026-09-21 02:39:29 +02:00
Replace 'GetPlayerByEntityId' with 'NetworkGetPlayerIndexFromPed' (#199)
seems like 'GetPlayerByEntityId' is no longer supported and always return -1 to onPlayerKilled event so, I replace it with 'NetworkGetPlayerIndexFromPed' to make it work properly.
This commit is contained in:
@@ -33,7 +33,7 @@ Citizen.CreateThread(function()
|
||||
end
|
||||
end
|
||||
|
||||
local killerid = GetPlayerByEntityID(killer)
|
||||
local killerid = NetworkGetPlayerIndexFromPed(killer)
|
||||
if killer ~= ped and killerid ~= nil and NetworkIsPlayerActive(killerid) then killerid = GetPlayerServerId(killerid)
|
||||
else killerid = -1
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user