Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lua/glide/server/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
Expand Down
Loading