Tool ConVar Limits

Tl;dr: Limit the tools on your server simply and easily so they can still be used by all but limited to prevent minging, abuse in races, etc.

Information

As part of my ongoing quest to make simple addons for an otherwise vanilla GMod, I’ve come up with an addon known simply as Tool ConVar Limits. This is one simple script that modifies the GetInfoNum and GetInfo functions, which are used by the server to read ConVars off the client. All the script does is simply add a check to cap values based off a settings file, or check specifically if a non-numerical value is accepted. What this means is that, for example, you can allow turrets on your server for light combat, while capping their damage and force to prevent minging. You can put a cap on weld force limits, or even limit the power and model of thrusters. Using this on a server without the weight tool or with one modified to not work on thrusters, you can limit everyone to using similar-weight thruster models, thus capping everyone’s maximum thruster output.

A sample settings file is included with some presets to help with formatting.

Enjoy,

Downloads
http://www.garrysmod.org/img/?t=dll&id=78820
http://www.filefront.com/images/buttons/download/download_now.gif

Note: It has been brought to my attention that you can still obviously adv. dupe paste contraptions with values exceeding the limits - therefore, this add-on would be best used on a server with adv. dupe uploading disabled (like certain build servers and many custom gamemodes.)

awesome man, thanks.

quite useless, since you can still advdupe things with properties exceeding the limits.

if you have no advdupe, however, this would work

Good point. I’ll have to see if I can find a workaround for that, not really sure how it could be done, though.

As is though, it’s fine if you have adv. dupe uploading disabled (and it has been since the last time the server’s dupes were cleared.)

you’ll probably need to use debug.get/setupvalue since all of the hook tables are usually locals.

[lua]do
local foo = 1234
function getfoo()
return foo
end
end

print(debug.getupvalue(getfoo, 1))
–[[
result:
foo 42
]][/lua]

Does anyone have a copy of this? or see if they can download it, when i do it says it is damaged.