diff --git a/lua/glide/server/util.lua b/lua/glide/server/util.lua index 9f34f494..75c98aae 100644 --- a/lua/glide/server/util.lua +++ b/lua/glide/server/util.lua @@ -234,6 +234,15 @@ function Glide.CanEnterLockedVehicle( ply, vehicle ) return false end + if DarkRP then + if IsValid( ply.switchingSeats ) and ply.switchingSeats == vehicle then + return true + end + + return false + end + + return cvarAlwaysEnterLocked:GetBool() or Glide.CanLockVehicle( ply, vehicle ) end @@ -258,11 +267,14 @@ function Glide.SwitchSeat( ply, seatIndex ) return end + ply.switchingSeats = vehicle ply:ExitVehicle() ply:SetAllowWeaponsInVehicle( false ) ply:EnterVehicle( seat ) hook.Run( "Glide_PostSwitchSeat", ply, seatIndex ) + + ply.switchingSeats = nil end --- Finds and returns all human players near a certain position.