From 2917ad32d773955898bf17a2cca8b60118dcf3cd Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 11 Mar 2021 19:01:05 +0000 Subject: [PATCH] refactor: SyncData() to use GetOtherPedServerId() --- cl_sync.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cl_sync.lua b/cl_sync.lua index 81a4951..800d61f 100644 --- a/cl_sync.lua +++ b/cl_sync.lua @@ -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