fix: still syncing when there's no other player

This commit is contained in:
Dan
2021-02-26 15:47:41 +00:00
parent 3fd458ac63
commit 9a1a58671b

View File

@@ -35,9 +35,11 @@ SYNC = {}
function SYNC:SendPowerState( state ) function SYNC:SendPowerState( state )
local otherPed = PLY:GetOtherPed() local otherPed = PLY:GetOtherPed()
if ( otherPed ~= nil and otherPed ~= 0 ) then
local otherPly = GetPlayerServerId( NetworkGetPlayerIndexFromPed( otherPed ) ) local otherPly = GetPlayerServerId( NetworkGetPlayerIndexFromPed( otherPed ) )
TriggerServerEvent( "wk_wars2x_sync:sendPowerState", otherPly, state ) TriggerServerEvent( "wk_wars2x_sync:sendPowerState", otherPly, state )
end
end end