Simple Admin (sAdmin)
- version 0.4 Beta
This is a simple mod I made with which to administrate servers.
I made it to practice and learn Lua.
After using this mod and/or seeing pictures of it, you may want to call this mod “A sad Attempt at an admin mod”, “Failmin”, “sAdminge”, or other names.
Before I fasten on my firesuit, let me tell you a few things:
[li]I am not an expert/experienced/good/decent Lua coder (as you probably can tell by my posts here at FP). The code you will see is probably the worst you can imagine. This is about my 4th thing to make with Lua ever, and I wouldn’t know good code if it bit me in the… moving on.[/li][li]This mod is still in beta, so while I have done my best to find any bugs, I probably wont have found all of them. Also, some of the stuff needs improving still, such as the order of the items in the command menu and such.[/li][li]This mod does not have a long and ridiculous acronym for a name.[/li][li]This mod was not made to send the current admin mods to the depths.[/li][li]This mod does not have chat commands, except for the Admin chat.[/li][li]I do not have knowledge of Gmod hooks that other admin mod makers did not.[/li][li]This mod uses Valve’s banning system.[/li][li]This mod is definitely not revolutionary.[/li][/ul]
If you were looking for a mod with any of that, I’m sorry, you won’t find it here.
Now that I have gotten the bad things out of the way, let me list some of the good things about it:
[li]It has an easy to use GUI, in which commands are executed on players by right-clicking their names and choosing a command from the menu. So you have neither a sea of buttons nor a never-ending chain of menus, but a winning combination of different GUI elements.[/li][li]This mod is very simple and easy to use, which is good for people new to running a server.[/li][li]There is a total of: 2 tabs, 2 lists, and a maximum of 3 buttons on the main Admin menu.[/li][li]It’s almost painfully easy to write plugins for this mod.[/li][li]And all the standard features of an Admin mod.[/li][/ul]
To install this mod, drop the sAdmin folder into the garrysmod/addons directory.
After restarting your server, join it (preferably when no-one else is on the server) and type in the console:
**WARNING: The first person to do this will be set as the Owner, a rank which cannot be revoked without file editing.**
After you have done so, you will be notified that you have been promoted to Owner.
To bring up the admin menu, type this into the console:
bind <key> SA_CP
Where <key> is a key such as ‘t’, ‘v’, ‘z’, or anything else.
Then when you hit the key, it will bring up the menu.
If you are an admin, you will not see the Server Command button at the bottom of the menu, or the Set Admin and Remove Admin items of the command menu. Only Owners see these things.
To talk via chat to all admins and owners, type the character ‘;’ before a message, and it will be displayed to all the owners and admins, e.g.:
;blah blah blah
To change the map, press the map button in the lower right corner, select a map, and press Change Map.
The playerlist and ban list are not updated automatically (except when you unban a player, the banlist is updated). To update it, hit the Refresh button.
To unban a player, right click the ban and click “Unban” in the menu. The ban list loads the bans from the banned_user.txt, and because any bans less than permanent are not written to the file, you won’t be able to view them from this list, and also you will only be able to see the SteamID of the banned player, not their name. In future versions of this mod, I will implement my own ban system to ‘upgrade’ this.
Setting an owner cannot be done by menu, only by the console command SA_setOwner <name>.
To change the colour of the GUI, change the variable SA_WindowColour near the top of SA_client.lua. It’s one of the first things near the top, right after about 5 lines of comments.
To change the colour of admin teams, edit the colours in SA_shared.lua.
Please post anything you don’t like or like here, or any improvements you want made. This mod is under constant development, so any ideas you have (if I can do them) will probably be quickly added.
And the traditional show of gratitude. Thanks to:
- The people on FacePunch for answering my stupid questions
- Sadistic Slayer and Chrisaster for the same
- Sadistic Slayer and X1L3D for letting me test the mod on their server
- Galago for continually testing this mod
- And the creators of the other admin mods for writing them and making them available to everyone to learn from.
Without the above people, this mod wouldn’t have happened. So if you don’t like it, blame them.
v0.4b: Added CEXEC and VoiceMute, cleaned the code up a bit, made it use team colours instead of changing player teams, which now will not screw up gamemodes, made the GUI look prettier, and fixed a stupid glitch where you could open more than one menu at a time (like the map change window, ServerCMD window, etc.) and when you closed one of them, it would spam errors.
v0.3b: Added Ragdoll Player, and made the command menu items appear in alphabetical order.
v0.2b: Added Warp Player to You, Warp to Player, and Give Weapon.
v0.1b: Fixed the bug where users grow ridiculous amounts of armpit hair.