feat(sync): require passenger view enabled for remote decors

This commit is contained in:
Dan
2021-03-19 14:12:22 +00:00
parent 338f3bb243
commit ca579d020e

View File

@@ -281,12 +281,18 @@ SYNC = {}
----------------------------------------------------------------------------------]]-- ----------------------------------------------------------------------------------]]--
-- Returns if the given player has the remote open -- Returns if the given player has the remote open
function SYNC:IsRemoteAlreadyOpen( ply ) function SYNC:IsRemoteAlreadyOpen( ply )
return DecorGetBool( ply, "wk_wars2x_sync_remoteOpen" ) if ( not RADAR:IsPassengerViewAllowed() ) then
return false
else
return DecorGetBool( ply, "wk_wars2x_sync_remoteOpen" )
end
end end
-- Sets the remote open decor for the local player to the given state -- Sets the remote open decor for the local player to the given state
function SYNC:SetRemoteOpenState( state ) function SYNC:SetRemoteOpenState( state )
DecorSetBool( PLY.ped, "wk_wars2x_sync_remoteOpen", state ) if ( RADAR:IsPassengerViewAllowed() ) then
DecorSetBool( PLY.ped, "wk_wars2x_sync_remoteOpen", state )
end
end end
-- Used to get the other ped (driver/passenger) in a vehicle and calls the given callback. This function will only work -- Used to get the other ped (driver/passenger) in a vehicle and calls the given callback. This function will only work