feat: sync will only work if the player can control the system

This commit is contained in:
Dan
2021-03-02 21:00:39 +00:00
parent 4231b71ea4
commit c2ea0dbfe7

View File

@@ -37,12 +37,14 @@ SYNC = {}
Sync functions Sync functions
----------------------------------------------------------------------------------]]-- ----------------------------------------------------------------------------------]]--
function SYNC:SyncData( cb ) 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 if ( otherPed ~= nil and otherPed ~= 0 and IsPedAPlayer( otherPed ) ) then
local otherPly = GetPlayerServerId( NetworkGetPlayerIndexFromPed( otherPed ) ) local otherPly = GetPlayerServerId( NetworkGetPlayerIndexFromPed( otherPed ) )
cb( otherPly ) cb( otherPly )
end
end end
end end