HLDS Guides for Newbies
Created by Vadakill
 
Introduction

One of the coolest tools for Half-Life dedicated servers is AdminMod (http://www.adminmod.org). This program allows you to administer your server without remembering all those pesky console commands. Not only this but you can do some other pretty dang cool things with it such as setting up partial administration abilities to some of your regular players, map voting, simple banning, reserved slots and name reservation so no one can masquerade as you.

Okay, so how do you get vanilla AdminMod to install and run on your newly established Natural-Selection server? Well, read on and I'll show you how! If you haven't read my previous guides you should do so; it has some basic information on my terminology and how to install some applications such as lynx, a text based web browser.

 
Preparing for Installation

Downloading AdminMod:
First thing you need to do is log yourself in as your user account, not as root. Change directory to the "hlds_l" directory.
 
Code cd /home/username/hlds_l

OR

cd /usr/home/username/hlds_l

You can either go to www.adminmod.org and pick a mirror to download from or you can then download the .tar package by running the following command:
 
Code lynx http://umn.dl.sourceforge.net/sourceforge/halflifeadmin/halflife-admin-2.50.56a.tgz

This will start the lynx web browser will ask you if you want to D)ownload or C)ancel. You want to hit "d" to begin the download process. When it's done lynx will ask you if you want to "save to disk" and should be highlighted. Hit enter once to select the save to disk and then hit enter again to confirm the filename. It should then save. Hit "q" to quit out of lynx.
 
Installing AdminMod

You should have a directory listing with the halflife-admin-2.50.56a.tgz file in there. You now need to extract it. Type:
 
Code tar zxvf halflife-admin-2.50.56a.tgz

Now if you do an "ls -l" should see the directory structure and a "Adminmod" directory should be listed. Change directory into "Adminmod" directory:
 
Code cd Adminmod

Next you need to install AdminMod for Natural Selection. So now type:
 
Code ./install_admin ns

A new prompt should come up asking if it should proceed with installation. Type a "y" and hit enter. You should then see something like this:

    Please enter the directory where your HL server is installed,
    or hit Return to accept the default.
    [/home/username/hlds_l]:

AdminMod installer asked you where your HLDS files are located. This is the location of your HLDS_L server *not* your NS server files. Usually the AdminMod installer is very good about detecting this path and the defaults are fine, just hit enter on your keyboard to accept it.

You should now see the following:

    Looks like you have Natural Selection installed in
    /home/username/hlds_l/ns.
    I can now install the AdminMod files. Proceed? (y/n) [y]

Type a "y" and hit enter to accept. It will begin to do a modify a bunch of files and set up a directory structure for your AdminMod files, don't panic this is normal. When it's done you will see:

    Shall I add the line to your server.cfg file? (y/n) [y]

Yes, this added line will allow your server to execute the configuration files for admin mod when it's done initializing its own variable. This is a good thing, let it do it by hitting "y" and then enter.

You are done! Congrats, AdminMod is installed. Now we need to configure it a little bit so that you, the admin, can exert your godly admintrative abilities on the masses. Okay, so I'm going a little far on that but it would be nice to be able to join your own server when it's full, eh?
 
Configuring AdminMod and Your Client

First thing we should do is change the maxplayers on the server and add an additional slot for you. You should have something like this already:
 
Code screen -A -m -d -S ns ./hlds_run -game ns +ip xxx.xxx.xxx.xxx +maxplayers 12 +map ns_eclipse

Just add one to the maxplayers so it looks like this:
 
Code screen -A -m -d -S ns ./hlds_run -game ns +ip xxx.xxx.xxx.xxx +maxplayers 13 +map ns_eclipse

Editing the adminmod.cfg file:

Now, we'll turn that extra slot into a reserved slot and make some other modifications to the basic adminmod.cfg. To do this you'll need to change to the directory that holds the adminmod config files. It should be something like hlds_l/ns/addons/adminmod/config. So starting from the hlds_l folder you would type:
 
Code cd ns/addons/adminmod/config

And then you'll need to edit the file. I use "vi" for my editor, so we will edit the adminmod.cfg file with vi like this:
 
Code vi adminmod.cfg

Now you should be in a text editor. Vi can be difficult to use at first but you will quickly get used to it. Some simple commands to get you started:
  • To escape or turning off any mode you are in you can just hit the ESC key twice.
  • To begin typing information press the "i" key until an "--insert--" appears near the bottom of the screen. Hit ESC to get out of this mode.
  • To delete a single line make sure your out of any other mode by hitting "ESC" and then type "dd"
  • To delete 10 lines, make sure your out of any other mode by hitting ESC and then type "d10d"
  • To go to the beginning of your file type "gg", to go to the end hold down SHIFT GG
  • To go to a specific line do SHIFT G, the line number then SHIFT G again.
  • To save your file and quit vi do, SHIFT ZZ
  • To undo the last mistake you made do ":u"
  • If you made a lot major mistakes and you want to quit without saving your file, do ":q!"

There, not too bad right? Now we need to edit some of the lines in the default adminmod.cfg file. Most of these should be left at the default values but I'll point out some you should change to customize and lessen the annoyance of your players. I'll give examples of my adminmod.cfg file.

This one shows a one time message to a player about 10-20 seconds after they connect and join the game. I put a simple little message there to encourage fair play.
 
Code admin_connect_msg "Play hard, Stay cool and Enjoy the game!"

These two are related. They control how often the repeat message is printed to the player's screen. I set this to 20 minutes. Change the repeat message to something that advertises your server. This is what I have in mine:
 
Code admin_repeat_freq 1200
admin_repeat_msg "Visit us at www.Vadakill.com"

It may be tempting to turn this on but it can mess you up as a new AdminMod user. Leave this at "0" until you have more experience, you can always change it later.
 
Code encrypt_password 0

Password field is an important component to authenticating your client, this will make sense later. Change this to something else such as:
 
Code password_field _pw-boboserver

This one is important. This is how many of the total slots on your server are reserved for admin access. The rest of the slots will be public slots. For example, we made a maxplayers of 13. In reality only 12 of those will be available to the general public and 1 will be available for admins with the proper access level.
 
Code reserve_slots 1
reserve_type 0

Reserve type 0 means that public slots will be used in preference to reserved slots. Two scenarios I can think of: Your server has 13 slots, 12 public 1 reserved and currently has 11 players active. You then join the server making yourself the 12th player. The reserved slot remains open and no other people can join the server without having the proper access level.

Another scenario is the server is full with 12 players, you join then join and have the proper access level to use the reserved slot. AdminMod authenticates you and you now take up the 13th slot on the server. Then a few minutes later someone quits the server. You then slide into the public slot and the reserved slot is open again.

Once all the options you want are successfully changed you'll want to SHIFT ZZ to save and close the file


Adding yourself to the users.ini file:

You should already know your WONID, if you don't join any server and type "status" in the console. Write down your WONID, you'll need this in a little bit.

The next important thing we need to do is set up permissions for various users. The users.ini file found in the addons/adminmod/config directory allows you to do this. To edit this file type:
 
Code vi users.ini

You should see the familiar interface of vi. There are some commented lines here which have some general instructions on how the users.ini file works. Just skip down to the bottom where you have some free space and type the following:
 
Code Wonid:password:accesslevel
//Your Name

A little java help calculator which can help you find out what access levels you need can be found on the AdminMod site here: http://www.adminmod.org/help/online/Admin_Mod_Reference/Access_Levels_and_Respective_Admin_Commands.htm

Now, for example, say my WONID was 456789, the password I wanted was "boborulez", the access level I wanted had control over everything AdminMod had to offer and my name was Bobo. I would then type:
 
Code 456789:boborulez:131071
//Bobo

Now that you are done editing this file do a SHIFT ZZ to save the file and close vi. Now that we are done with the server configuration you'll need to add a line to your client machine so that you can authenticate with your server and have admin control over it.

Modifying Your autoexec.cfg File on Your Client

Open your ns game folder on your hard drive so that you can see the contents inside. Up on your menu bar click the "Tools" then click "Folder Options". Next click the "View" tab. Uncheck the checkbox next to "Hide extensions for known file types" and select "Show hidden files and folder" then click the OK button on the bottom.

Now you should see the contents of your NS folder. Go to "File" then click "New" then "text document". It should create a new file called "New text document.txt" change this to "autoexec.cfg". It might warn you about changing the file extension, just click okay to accept it.

Next open the file by right clicking the file and then "open" or "open with...", open it with notepad.

In the open file type in the following line:
 
Code setinfo _pw-boboserver boborulez

...then save the file and close it.

You should then be able to start up your server and join it like normal. Test admin mod by running a few commands such as:
 
Code admin_say this is cool!
admin_map ns_caged

If those work, congratulations! You've successfully set up AdminMod on your server!