Removing Prop Driving

I manage a server and its getting annoying when players use the Prop Drive in the context menu to move props around. I need some way I can disable the Prop Driving, keep in mind that I am not a coder but I know basics. As long as its disabled I’m good, but it would also be good if you could make it print something in chat like “Prop Driving Is Disabled”. I’m pretty sure this is possible because I’ve found code where you can disable the Workshop Dupes Spawning.

So in short I need the coding and the located to place it so I can disable the Prop Driving Function in the Context Menu… Preferably with it saying “Prop Driving Is Disabled”




hook.Add( "CanProperty", "omghedrove", function( ply, property )

    if( property == "drive" ) then
        ply:ChatPrint("You're not allowed to drive.")
    end

    return false;

end )




Should work, if it does not post the error you get.

Can I get the location of where this should go?


hook.Add( "CanDrive", "CantDrive", function( _p, ent )
    return false;
end );

put in garrysmod/lua/autorun/server/somefile.lua or in addons/someaddon/lua/autorun/server/somefile.lua

Thank you this worked very well, no errors.

I recommend using Busan’s code instead of AIX-Who for drive. Its so much better in many levels.

AIX-Who’s code will stop every property from working, not just driving.

Yeah I actually just realized that… AIX-Who’s code disabled the property menu.

oh shit, my bad.

Use Busan’s!