CS-Reloaded Banner
Welcome, Guest. Please Login or Register.
Download Third Map Pack!
Get more packs here

Home Help Search Login Register

CSReloaded Forums  |  Guides and FAQ  |  Articles (Moderators: Ryo-Ohki, Porter, Kaoz)  |  Topic: HLDS, AdminMod, Bots, and Stats
Pages: [1] Reply Notify of replies
   Author  Topic: HLDS, AdminMod, Bots, and Stats  (Read 423 times)
Porter
[Wumpa]
Board Admin
*****
Karma: +176/--88

Offline

Gender: Male
Posts: 3910

Wumpa+Porter
View Profile WWW E-Mail
HLDS, AdminMod, Bots, and Stats
« on: March 13, 2003, 12:26:45 AM »
Reply with quote

This is a re-creation of a thread I was working on with LeGrand about setting up a dedicated server with bots and stat tracking...
Logged

[Wumpa] Porter
  --Silent, professional, lethal... sometimes.
Porter
[Wumpa]
Board Admin
*****
Karma: +176/--88

Offline

Gender: Male
Posts: 3910

Wumpa+Porter
View Profile WWW E-Mail
HLDS Requirements
« Reply #1 on: March 13, 2003, 12:27:47 AM »
Reply with quote

Alright! Well let me just make sure I have things straight...

You want to:
  • track stats with PsychoStats.
  • track the damage and stuff that StatsMe does.
  • play with bots.
  • play on the same machine as the dedicated server.

If I have all this right, the here's what you'll need:
And after you have all of that, here's what you'll do:
Make sure HL and CS are up to date.
  • Create shortcuts for HLDS and CS (client).
  • Install & check AdminMod
  • Install & check PlBots (or Realbots)
  • Install & check StatsMe
  • Install & check PsychoStats

I realize those instructions are a little vague, but downloading the packages is a good start, and we can go from there eh?
Logged

[Wumpa] Porter
  --Silent, professional, lethal... sometimes.
Porter
[Wumpa]
Board Admin
*****
Karma: +176/--88

Offline

Gender: Male
Posts: 3910

Wumpa+Porter
View Profile WWW E-Mail
Getting HLDS Set Up
« Reply #2 on: March 13, 2003, 12:28:32 AM »
Reply with quote

First things first. If you have Half-Life (the full game) installed on your computer, then you already have the dedicated server. (I'm assuming you've got the latest patches installed: HL 1.1.1.0 and CS 1.5) In order to launch HLDS, you'll need to create a shortcut on your Desktop (or wherever you feel like putting it) that points to your hlds.exe (which is in the same folder as hl.exe).

The easiest way to do this is right-clicking on hlds.exe and holding down the button, then dragging the outline to your Desktop, and choosing "Create Shortcut here" from the menu that pops up when you let go of the mouse button.

After you create it, edit the Properties for the shortcut and modify the "Target" line by adding -noipx -nomaster -game cstrike  +sv_lan 1 +maxplayers 10 +map de_dust to the end of it. It should end up lookng something like this:

Target: C:\Sierra\Half-Life\hlds.exe -noipx -nomaster -game cstrike  +sv_lan 1 +maxplayers 10 +map de_dust

  • -noipx  ~  Disables IPX so your game only shows up once in the LAN listing.
  • -nomaster  ~  Tells HLDS not to announce your game to the WON master servers.
  • -game cstrike  ~  Does the same thing as the client: tells Half-Life which mod to load on start-up.
  • +sv_lan 1  ~  Sets the sv_lan cvar to 1 to prevent contact with master servers. (Overlaps with -nomaster, but better to specify too much than not enough.)
  • +maxplayers 10  ~  The maximum number of players that can play on your server at once. CS in general doesn't like numbers higher than 20. This number has the greatest effect on bandwidth usage. If you're hosting an internet game, making this too high will choke your connection (on cable or DSL) when the server fills up, and you'll have palyers complaining about lag all the time.  On a LAN-only, you should be able to leave it at 20 as long as your machine is relatively fast.
  • +map de_dust  ~  Tells the server which map to load on start-up. You can make this any map you want.


Now when you double-click on your shortcut, a "DOS Box" looking window will pop up and start scrolling information. This is what your server looks like when it's running. To terminate it, you can either close the window (which is the ugly way), or type exit followed by [ENTER] (the clean way).

In any case, these are the absolutely essential command line parameters. There are other things you can configure, but those will go in your server.cfg; which I will cover in my next post when it's not 4 in the morning. 
Logged

[Wumpa] Porter
  --Silent, professional, lethal... sometimes.
Porter
[Wumpa]
Board Admin
*****
Karma: +176/--88

Offline

Gender: Male
Posts: 3910

Wumpa+Porter
View Profile WWW E-Mail
HLDS Configuration
« Reply #3 on: March 13, 2003, 12:29:20 AM »
Reply with quote

Before we get into Adminmod, let's make sure the dedicated server is working the way we want. We've already created a shortcut to launch hlds with all the parameters that can only be set on the command line, but there are many other things that can be set in a config file. Config files use the extension .cfg but are really just plain text files. You can open them using NotePad or WordPad (or my personal favorite: ConTEXT).

Config files are made up of commands that you normally type in the console. You can also include comments by using a double-backslash "//" like many programming languages. Comments are ignored by hlds when it reads the config file. Configs are useful for running a lot of commands at once or at specific times (like when your server starts). For example, any time you launch Half-Life, a file named autoexec.cfg is executed. By the same token, when a dedicated server launches or changes its map, it looks for and runs server.cfg. (Listen servers run listenserver.cfg when they launch or change maps.)

The server.cfg is where we want to set the majority of our configuration variables or cvars. Cvars are variables that control how HLDS behaves. Examples of cvars include mp_c4timer (which controls how many seconds the bomb ticks away before exploding), and mp_startmoney (which controls how much cash you get at the beginning of a map/round). Every cvar has a default value. If you don't want to change it, you don't have to put it in your server.cfg. Only the values you want to differ from the defaults absolutely NEED to be specified, but I include most of the common cvars anyway so I can remember which ones do what.

Many cvars are boolean-- which means they are either true or false. For these cvars, a setting of 1 means it is on or active, and a setting of 0 means off or inactive. Other cvars are integer or float values. Integers are whole numbers, and floats are numbers with a decial point. Still other cvars are string values, which consist of a string of characters. And lastly there are some cvars that take unusual arguments. Sometimes this is a setting number, like mp_logdetail. Sometimes it's more than one argument, like logaddress. In my example below, hostname accepts a string, allow_spectators accepts a boolean, and decalfrequency accepts an integer/float. One last note; string cvar arguments should always be quoted with double quotes like hostname. This help hlds figure out where your setting stops.

Here is my personal server's config:
Code:
/////////////////////////////////////////////////////////////////////////////
//                        General Server Settings                          //
/////////////////////////////////////////////////////////////////////////////

hostname "[Wumpa] Samurai"  // Server's name.
rcon_password secret        // Remote console password.

log on                      // Enable logging?
logaddress 127.0.0.1 27500  // IP to send log to.

allow_spectators 0  // Can people watch?
pausable 0          // Is the game pausable?
decalfrequency 20  // How often a player can spray their decal. (secs)

sv_lan 1            // LAN only game?
sv_maxspeed 320    // Maximum player move speed.
sv_cheats 0        // Cheats enabled?
sv_aim 0            // Auto aim enabled?
sv_minrate 500      // Mimimum client data through-put. (kilo-bits / sec?)
sv_maxrate 500000  // Maximum client data through-put. (kilo-bits / sec?)
sv_allowupload 1    // Allow clients to upload sprays to the server?
sv_restartround 10  // Match restarts x secs after both teams have players.
sv_proxies 1        // Allow HLTV proxies?
sv_voiceenable 1    // Allow voice comm?



/////////////////////////////////////////////////////////////////////////////
//                        General Map Settings                            //
/////////////////////////////////////////////////////////////////////////////

mp_timelimit 20.0      // Map time limit. (mins)
mp_roundtime 5.0      // Round time limit. (mins)
mp_tkpunish 1          // Punish team killers?
mp_hostagepenalty 5    // Kill x hostages and you get kicked. (0 = off)
mp_forcechasecam 1    // Dead players may only ghost teammates?
mp_allowspectators 0  // Spectators allowed?
mp_friendlyfire 0      // Shooting teammates hurts?
mp_flashlight 1        // Flashlight is allowed?
mp_footsteps 1        // Running players can be heard?
mp_logmessages 1      // Log player chat messages?
mp_c4timer 45          // C4 fuse timer. (secs)
mp_logdetail 3        // Logs all attacks? (3 = including on teammates)
mp_chattime 30        // Seconds after end of round before next map loads.
mp_startmoney 800      // Ammount of money at start of map.
mp_buytime 1.5        // Minutes from round start to buy weapons.
mp_freezetime 3        // Time each round before players can move. (secs)
mp_fadetoblack 0      // Fade screen to black after dying?
mp_mapvoteratio 0.45  // Percent of players neede to win a map vote.
mp_autokick 1          // Kick idle players?
mp_ghostfrequency 0.1  // ?

/////////////////////////////////////////////////////////////////////////////
//            Execute the Admin Mod configuration file                    //
/////////////////////////////////////////////////////////////////////////////
exec addons/adminmod/config/adminmod.cfg

Note the very last line. This is our lead in to our Adminmod configuration. The exec command tells hlds to stop what its doing, go execute another config, and then come back to the current one.

I'm sure I've probably missed some important detail, but I've been typing this for a very long time now, so I'll wrap it up.

LeGrand: Make yourself a server.cfg file using mine as a reference. Make sure you have the same "exec" command at the bottom of it like mine for Adminmod. After you change whatever values you want to, we're going to make one more shortcut. This one is going to launch CS with the necessary options to work with your dedicated server. You can start by right-click-dragging hl.exe to your Desktop like we did for hlds.exe. Then get Properties and modify the Target line to look like this:

C:\SIERRA\Half-Life\hl.exe -game cstrike -console -port 27016 +exec adminpass.cfg

  • -console lets you access the HL console from inside the game. I trust you were already aware of this though.
  • -port 27016 tells CS to use a different TCP/IP port for its connection to the server. Standard is 27015, but the dedicated server you'll be running is going to b using that port, so the client needs to use something different.
  • +exec adminpass.cfg is going to execute a config file we're going to create (next time) that will hold your admin password. We need to make sure your password cvar is set so when you connect to the server it will recognize you as an admin, and this file is going to do that for us.


That's it for now. Let me know if you have any problems or questions. I've added you to my MSN list LeGrand, and I'm going to start leaving that connected these next couple days. If you see me on, give me a shout. Good luck! 

PS: Sorry about the incredbile lengthiness of this post! Also, I am writing this for more than just LeGrand, so if you know anything I've already covered, don't be insulted: I'm just trying to make sure I cover everything
Logged

[Wumpa] Porter
  --Silent, professional, lethal... sometimes.
Porter
[Wumpa]
Board Admin
*****
Karma: +176/--88

Offline

Gender: Male
Posts: 3910

Wumpa+Porter
View Profile WWW E-Mail
rcon Quicky
« Reply #4 on: March 13, 2003, 12:30:29 AM »
Reply with quote

Actually, you should probably remove the rcon_password line altogether unless you plan on logging in to control your dedicated server remotely. It can be a security hole, and if you don't plan on using it, it's better to leave it closed.

rcon stands for remote console. It allows you to send commands to your server from anywhere on the internet or LAN (depending on where your server is running). The rcon_password in my example server.cfg is there for completeness. (My server's password isn't really "secret", but I'd like to keep it a secret. )

BTW, this password doesn't have anything to do with Adminmod. We'll be settng a different password-field for that purpose in the adminmod.cfg file. (That's one of the things in the post I'm writing now.)

Stay tuned HLDS fans!
Logged

[Wumpa] Porter
  --Silent, professional, lethal... sometimes.
Porter
[Wumpa]
Board Admin
*****
Karma: +176/--88

Offline

Gender: Male
Posts: 3910

Wumpa+Porter
View Profile WWW E-Mail
Adminmod- Server Configuration
« Reply #5 on: March 13, 2003, 12:31:48 AM »
Reply with quote

So Adminmod is probably the most useful thing in the world for the Half-Life engine. Besides all of it's built-in functionality, it's scripting engine allows you to add practically any functionality you could think of to it. The downside is that it's a little confusing to get installed and configured. The latest version helps ease this a bit by using the new addon layout described at the United Admins site.

The added benefit to installing AM is that it installs MetaMod for you. MetaMod is a Half-Life plugin that "hooks" the internal routines in the Half-Life engine and allows you to modify their actions. Pretty much every other add-in available for HL is a MetaMod plugin.

Installing Adminmod is pretty straightforward. My explanations are geared for the Windows package of AM, but in truth the linux version isn't all that much different. Download the latest package (currently v2.50.50), and extract the contents to your Half-Life folder. Then open the Adminmod folder that was created and run install_admin.vbs A series of dialog boxes will pop up explaining what is about to happen and asking for information. The first is an explanation of the script, the second asks to scan your Registry for Half-Life's location (go ahead and let it unless you're really paranoid), the third verifies the directory it found, and the fourth is the important one: It asks you which mod you like to install Adminmod into. Enter cstrike for Counter-Strike. One more dialog box will show up letting you know AM is "minimally installed" and then the script will exit. This was the easy part.

(Note: A great source of information (although a little complicated for a novice user) is the AdminMod-Win-Manual.chm that can be found in the Adminmod/docs/ directory.)

Next we need to create and/or modify a couple of configuration files. The first is called plugin.ini and can be found in cstrike/addons/Adminmod/config/. This file controls which AM plugins are loaded with Adminmod. There are specific plugins for TFC and CS, and since we're setting up a CS server, we need to comment out the listing for TFC. Open plugin.ini and make sure there is a hash (#) or a semi-colon (;) (both of these are comment markers) in front of the listing for addons/adminmod/scripts/plugin_TFC.amx, and NO hash or semi-colon in front of addons/adminmod/scripts/plugin_CS.amx. You can enable or disable any other plugins you want (including those available from the Adminmod AScript website) in this file. (Notice that directories in this file are sperated by unix-style slashes instead of DOS backslashes. Also notice that the paths to these files are relative to your mod directory-- in this case "cstrike".)

The next file is users.ini. This file controls who has access to the Admin commands, and how much access each admin has. For now, let's just get you set up. Open users.ini and add the following lines (replacing myPass and myWONID with the correct values):

myWONID:myPass:130047
LeGrand:myWONID:-16384


The format to the users.ini is basically id:password:accessLevel. id is either a player name or a WONID. password is that particular user's admin password, and access level is how much of Adminmod this user has the priviledge to use. Access levels are really tricky to figure out, so it's best to use the Access Level Calculator in the Reference section of the AdminMod Help file.

Anyway, the two lines above give you admin access via WONID first, and by player name second. That means when you're playing on your home machine, you will authenticate by WONID, but if you're on someone else's computer with a different WONID, you can change your name to "LeGrand" and still have admin access. You can get your WONID by connecting to a server, dropping your console, and typing status followed by [ENTER]. Pick your name out of the list that is generated, and match it to your "uniqueid". This is your WONID.

We have one last file to configure on the server's end of things, and that's the adminmod.cfg. This one controls all of Adminmod's "personal" cvars. All of the cvars in this file are documented pretty well as to their use, so basically you should set these to whatever you think is appropriate. There are a few that we need to focus on specifically though.

The first is admin_bot_protection. Since you plan on using Realbots on your server, you need to set this cvar to 1 to make sure AM doesn't try to affect the bots. The second is admin_cs_restrict. This should also be set to 1 to enable the ability to restrict weapon usage. This cvar doesn't restrict anything on it's own, but it is what controls whether you can restrict anything or not. Bots sometimes get to ignore this though, so ou might not be able to keep them from AWPing you. Next is password_field. This cvar controls what the name of your server's password field will be. You will be setting your personal admin password in a seperate file (the adminpass.cfg I mentioned last time) for using to connect to the server. Something like "_pw-legrand" would be a good idea. (Note: password fields MUST start with an underscore to prevent a security vulnerability that could allow cheaters to learn your admin password.) You can safely leave the rest of the cvars in adminmod.cfg with their default values if you like.

We're done messing around with server-side AM files now! Next up, configuring the client-side and testing it out!
Logged

[Wumpa] Porter
  --Silent, professional, lethal... sometimes.
Porter
[Wumpa]
Board Admin
*****
Karma: +176/--88

Offline

Gender: Male
Posts: 3910

Wumpa+Porter
View Profile WWW E-Mail
Adminmod- Client Configuration
« Reply #6 on: March 13, 2003, 12:32:41 AM »
Reply with quote

Now we need to set your client password so you have access to your admin commands when you join the server. To do this, create a new cfg file in your cstrike directory called adminpass.cfg. In this file, place the following lines:

echo "--- Setting AdminMod password ---"
setinfo "_myPassword-Field" "mypassword"


_myPassword-Field should be the password_field cvar you set in adminmod.cfg. mypassword should be the password you set for yourself in users.ini. After you're done, save and close the file.

To test what we've got so far, start your dedicated server using the shortcut you created. Once it's done loading (it'll try to download a Valve security patch, then load the first map) type meta list in the console and hit [ENTER]. AdminMod should be listed. This will let you know it loaded correctly. Now start CS using the shortcut you created with the "+exec adminpass.cfg" in the Target line and go the LAN game menu. Your server should show up in the list. If it doesn't, get to your console and type connect x.x.x.x where "x.x.x.x" is the IP of your machine. You should start connecting to your dedicated server. While it's going, you should see messages saying

--- Setting AdminMod password ---
and
[ADMIN] Password recieved.
[ADMIN] Password accepted for user "LeGrand".


If everything goes smoothly: once you're in-game drop your console and type admin_help (followed by [ENTER]). You should get the first 10 entries out of a list of 60 or so. If you so, then AM is configured and working properly. 

Once again, this is a whole lot to absorb. Just take it one step at a time and be patient. And as always, let me know if you have questions or comments or if anything doesn't work right. Next time, we tackle Realbots. 
Logged

[Wumpa] Porter
  --Silent, professional, lethal... sometimes.
Porter
[Wumpa]
Board Admin
*****
Karma: +176/--88

Offline

Gender: Male
Posts: 3910

Wumpa+Porter
View Profile WWW E-Mail
AM- Skipped Topics
« Reply #7 on: March 13, 2003, 12:33:48 AM »
Reply with quote

You might have noticed a couple things I skipped over. For example, we didn't touch Adminmod's ips.ini, maps.ini, models.ini, or wordlist.txt. (I'm also mentioning them here for my own sake so I can come back and fill them in if need be.)

These files control other aspects of AM: like giving admin access to certain IPs, restricting which maps you can vote for, restricting who can use which character models, and what words are considered vulgar on your server.

If you like LeGrand, I can go over them, but I skipped them because for right now they're just not important. Also; like I said before, the AdminMod-Win-Manual is a great source of information if you're willing to spend the time to look it up. It can explain the purpose of these files about as well as I could.

There was something else that scratched the edge of my mind about HLDS in particular, but I can't recall what it was that I wanted to explain better. Maybe it'll come to be tomorrow.
Logged

[Wumpa] Porter
  --Silent, professional, lethal... sometimes.
Porter_Debug
Guest

E-Mail
Re:HLDS, AdminMod, Bots, and Stats
« Reply #8 on: April 03, 2003, 12:06:38 AM »
Reply with quote

I can reply to this thread, but ideally I shouldn't be allowed to.

(See the yabb thread about this: Allow Users)
Logged
StealthMode
Guest

E-Mail
Re:HLDS, AdminMod, Bots, and Stats
« Reply #9 on: June 07, 2003, 07:02:10 AM »
Reply with quote

Erm, you missed a lot of svars, and some command line parameters he COULD use. Check out server.counter-strike.net for more info....
Logged
Porter
[Wumpa]
Board Admin
*****
Karma: +176/--88

Offline

Gender: Male
Posts: 3910

Wumpa+Porter
View Profile WWW E-Mail
Re:HLDS, AdminMod, Bots, and Stats
« Reply #10 on: February 19, 2004, 08:47:18 PM »
Reply with quote

Just wanted to let people know this information is kinda of out-of-date since Steam was released. I'll try to update it at some point for Kitty and anyone else interested.
Logged

[Wumpa] Porter
  --Silent, professional, lethal... sometimes.
Pages: [1] Reply Notify of replies 
CSReloaded Forums  |  Guides and FAQ  |  Articles (Moderators: Ryo-Ohki, Porter, Kaoz)  |  Topic: HLDS, AdminMod, Bots, and Stats
Jump to: 

Powered by PHP CSReloaded Forums | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
Powered by MySQL
:[ Site Design by Ryo, scripts and backends by Porter and Ryo, banner by Supafly! Powered by PHP and MySQL ]:
Page created in 0.413 seconds.