• Disabling Jeeps, Help!
    8 replies, posted
How can i do this?
What gamemode are you playing?
If you're using sandbox and just want to disable vehicles, place this in a Lua file in /lua/autorun/server: [lua]hook.Add("PlayerSpawnVehicle", "DisableVehicles", function() return false end )[/lua]
@LuaMilkShake Thanks. Done. Please. Lock.
Oh, I didn't even think of the proper way to do it, which would be using sbox_maxvehicles 0.
[QUOTE=LuaMilkshake;33050549]Oh, I didn't even think of the proper way to do it, which would be using sbox_maxvehicles 0.[/QUOTE] If you do it through lua, you could unrestrict it to admins. Just something to think about.
[QUOTE=LuaMilkshake;33031570]If you're using sandbox and just want to disable vehicles, place this in a Lua file in /lua/autorun/server: [lua]hook.Add("PlayerSpawnVehicle", "DisableVehicles", function() return false end )[/lua][/QUOTE] This would restrict all vehicles. Not only jeeps. Use this instead: [lua]hook.Add("PlayerSpawnVehicle", "RestrictJeeps", function(ply, model, name) if name == "Jeep" then return false end return true end)[/lua]
or change line 2 of pennelord's to [lua] if name == "Jeep" and not ply:IsAdmin() then return false end [/lua] and then admins could spawn jeeps but no one else could
[QUOTE=pennerlord;33069152]This would restrict all vehicles. Not only jeeps. Use this instead: [lua]hook.Add("PlayerSpawnVehicle", "RestrictJeeps", function(ply, model, name) if name == "Jeep" then return false end return true end)[/lua][/QUOTE] I said in my post that it would disable all vehicles.
Sorry, you need to Log In to post a reply to this thread.