mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 08:26:27 +02:00
refactor: SyncData() to use GetOtherPedServerId()
This commit is contained in:
@@ -44,11 +44,9 @@ SYNC = {}
|
|||||||
-- player's server ID is passed to the given callback as an argument.
|
-- player's server ID is passed to the given callback as an argument.
|
||||||
function SYNC:SyncData( cb )
|
function SYNC:SyncData( cb )
|
||||||
if ( PLY:CanControlRadar() ) then
|
if ( PLY:CanControlRadar() ) then
|
||||||
local otherPed = PLY:GetOtherPed()
|
local otherPly = PLY:GetOtherPedServerId()
|
||||||
|
|
||||||
if ( otherPed ~= nil and otherPed ~= 0 and IsPedAPlayer( otherPed ) ) then
|
|
||||||
local otherPly = GetPlayerServerId( NetworkGetPlayerIndexFromPed( otherPed ) )
|
|
||||||
|
|
||||||
|
if ( otherPly ~= nil ) then
|
||||||
cb( otherPly )
|
cb( otherPly )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user