Stop Players Driving Vehicles


I was just wondering if there is anyway to stop people from being able to drive vehicles in your gmod server using a piece of code in your lua scripts?

If anyone knows please can they help me!



timer.Create(“timer_vehicle”, 1, 0, function(ply)
if ply:IsInVehicle() then
something like that, i don’t know if IsInVehicle is a function, sorry

I don’t want it too kill them. I want the vehicle to just not move when they try and accelerate? is this what you’re looking for?

not sure, sorry.
try a weld function?

Donkie, I want them to get in the vehicle, but not be able to move until I put another line of code which lets them move

-Snip- No support given to users using unlicensed game-modes.


I am basically working on GMR and on the countdown at the beginning of the race I want them to not be able to move

I can’t test at the moment but I assume you can mess with with MoveData in

No, that didnt work _Undefined

[editline]11th January 2013[/editline]

Thanks anyway :slight_smile:


function mySetupMove(ply, mv)
	if (ply:KeyDown(IN_WALK) and !ply:IsAdmin() and if (ply:InVehicle())) then
		return false
		return true
hook.Add("SetupMove", "mySetupMove", mySetupMove)

Maybe? :slight_smile: