Linux Server - Disabling Airbot, Jeep, and Jalopy

I wanted to know how to disable these things because they crash Linux servers, and I don’t want to get rid of all the vehicles.

The way to fix the crash if by replacing You can do so by reading this thread

Otherwise to disable vehicles, add this to your server.cfg:

“sbox_maxvehicles” “0”

sbox_maxvehicles blocks also normal chairs which don’t crashes servers.

Use this instea. Just put that code in to autorun folder of your server:

hook.Add ("PlayerSpawnVehicle", "VehicleRestrict", function(ply, mdl)
	if mdl == "models/buggy.mdl" or mdl == "models/airboat.mdl" or mdl == "models/vehicle.mdl" then return false end

I wasn’t able to get that to work and I put it in autorun just like you said.

local vehicleBlacklist = { "Jeep", "Airboat", "Jalopy" }
local function PreventVehicle( _, _, strName )
    return not table.HasValue( vehicleBlacklist, strName )
hook.Add( "PlayerSpawnVehicle", "prevent_vehicles", PreventVehicle )

Save file as Vehicleblock.lua and put it in autorun/server

[editline]28th May 2012[/editline]

Well, You don’t HAVE to do it as Vehicleblock but it works.