A handy command menu


Download a ready-made command menu for Half-Life
cmdmenu.zip [1.22 Kb] (downloads: 267)


Half-Life and its mods let you create your own menu to run preset commands quickly, without touching the console. With a menu you can, for example, quickly change your nickname, model or player color, switch servers and so on.

First we need to create a file called commandmenu.txt; this is the file where the menu is edited. Create it in the valve or valve_russian folder.
For example, C:/Games/Half-Life/valve/

To open the menu, add the following command to your config:

bind "m" "+commandmenu"

Here m is the key that brings up the menu when pressed.
You can also enter it in the console of Half-Life: start the game and press the ~ (tilde) key.

Now let's edit our menu.
It is structured like this:

"Number" "Menu item name" " console command"


The number is a digit on your keyboard: pressing 0-9 selects the items in the menu.

As an example, let's make a one-item menu for quickly connecting to the Emperor server.
To do this, paste the following text into commandmenu.txt:

"1" "Emperor server" "connect hldm.org:27015"


This is what the menu looks like.

A handy command menu


For all five of our HLDM servers the menu looks like this:

"1" "Emperor server" "connect hldm.org:27015"
"2" "Friendly server" "connect hldm.org:27016"
"3" "Fun server" "connect hldm.org:27017"
"4" "GunGame server" "connect hldm.org:27018"
"5" "AG server" "connect hldm.org:27019"


And here's how it all looks:
A handy command menu


You can also build a more complex menu with several sublevels:

"Section number" "Section name" {
"Item number" "Menu item name" "console command"
"Item number" "Menu item name" "console command"
"Item number" "Menu item name" "console command"
"Item number" "Menu item name" "console command"
}


Or even more complex:
"Section number" "Section name" {

"Section number" "Section name" {
"Item number" "Menu item name" "console command"
"Item number" "Menu item name" "console command"
"Item number" "Menu item name" "console command"
}

"Item number" "Menu item name" "console command"
"Item number" "Menu item name" "console command"
"Item number" "Menu item name" "console command"
}



And here is a ready-made menu; all that's left is to replace the default nicknames with your own.
All you need to do is copy the following text into commandmenu.txt

"1" "Names" {
"1" "[HLDM.ORG] Gamer" "name [HLDM.ORG]%Gamer"
"2" "HLDM.org" "name HLDM.org"
"0" "Exit" "slot10"
}

"2" "Models" {
"1" "scientist" "model scientist"
"2" "barney" "model barney"
"3" "robo" "model robo"
"4" "helmet" "model helmet"
"0" "Exit" "slot10"
}

"3" "Servers" {
"1" "UMI7EPATOP CEPBEP" "connect hldm.org:27015"
"2" "DPY}I{HbIU CEPBEP" "connect hldm.org:27016"
"3" "BECEJIbIU CEPBEP" "connect hldm.org:27017"
"4" "GunGame" "connect hldm.org:27018"
"5" "AG Mini" "connect hldm.org:27019"
"0" "Exit" "slot10"
}

"4" "Spectate" "spectate"

"0" "Exit" "slot10"


This is what the menu looks like:

A handy command menu

A handy command menu


P.S.
Note that if a console command needs a space, for example when your nickname contains one, write % instead of the space.
Example:

"1" "[HLDM.ORG] Gamer" "name [HLDM.ORG]%Gamer"

Selecting this item changes the player's name to [HLDM.ORG] Gamer


Download a ready-made command menu for Half-Life
cmdmenu.zip [1.22 Kb] (downloads: 267)