refactor: SyncData() to use GetOtherPedServerId()

This commit is contained in:
Dan
2021-03-11 19:01:05 +00:00
parent 5af79b8674
commit 2917ad32d7

View File

@@ -44,11 +44,9 @@ SYNC = {}
-- player's server ID is passed to the given callback as an argument.
function SYNC:SyncData( cb )
if ( PLY:CanControlRadar() ) then
local otherPed = PLY:GetOtherPed()
if ( otherPed ~= nil and otherPed ~= 0 and IsPedAPlayer( otherPed ) ) then
local otherPly = GetPlayerServerId( NetworkGetPlayerIndexFromPed( otherPed ) )
local otherPly = PLY:GetOtherPedServerId()
if ( otherPly ~= nil ) then
cb( otherPly )
end
end