From c2ea0dbfe78a9cf689a5d093fc5be705f43ac8d8 Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 2 Mar 2021 21:00:39 +0000 Subject: [PATCH] feat: sync will only work if the player can control the system --- cl_sync.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cl_sync.lua b/cl_sync.lua index 815d073..f34917f 100644 --- a/cl_sync.lua +++ b/cl_sync.lua @@ -37,12 +37,14 @@ SYNC = {} Sync functions ----------------------------------------------------------------------------------]]-- function SYNC:SyncData( cb ) - local otherPed = PLY:GetOtherPed() + if ( PLY:CanControlRadar() ) then + local otherPed = PLY:GetOtherPed() - if ( otherPed ~= nil and otherPed ~= 0 and IsPedAPlayer( otherPed ) ) then - local otherPly = GetPlayerServerId( NetworkGetPlayerIndexFromPed( otherPed ) ) + if ( otherPed ~= nil and otherPed ~= 0 and IsPedAPlayer( otherPed ) ) then + local otherPly = GetPlayerServerId( NetworkGetPlayerIndexFromPed( otherPed ) ) - cb( otherPly ) + cb( otherPly ) + end end end