mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 00:16:27 +02:00
feat: sync will only work if the player can control the system
This commit is contained in:
10
cl_sync.lua
10
cl_sync.lua
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user