From ca579d020e29027404a640f573f40c65e1ed5dd7 Mon Sep 17 00:00:00 2001 From: Dan Date: Fri, 19 Mar 2021 14:12:22 +0000 Subject: [PATCH] feat(sync): require passenger view enabled for remote decors --- cl_sync.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cl_sync.lua b/cl_sync.lua index e7045cb..e4aac8b 100644 --- a/cl_sync.lua +++ b/cl_sync.lua @@ -281,12 +281,18 @@ SYNC = {} ----------------------------------------------------------------------------------]]-- -- Returns if the given player has the remote open 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 -- Sets the remote open decor for the local player to the given 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 -- Used to get the other ped (driver/passenger) in a vehicle and calls the given callback. This function will only work