Jump to content

Recommended Posts

Posted

This tutorial will guide you through the process of creating a Commandmenu script. These scripts are fairly common now and have been around since the adoption of the Commandmenu in CS 1.3 (circa September of 2001). This type of script allows you to choose various commands or change settings in a GUI-type menu instead of using the console window to modify them.

 

Now we need to establish the basic information that is needed to get a Commandmenu script working properly. First, there is the commandmenu.txt file located in your cstrike directory.

 

 

 

You can open this file using Notepad and take a look. It should look similar to this:

 

 

 

The basic format within the commandmenu.txt is:

 

"Bound Key" "Button Text" "Command sent to server"

 

You will see that again later.

 

You can have a maximum of 40 menus, and a maximum of 100 buttons per menu. These limits give you more than enough options for any CS command you could ever want in a GUI menu.

 

For this tutorial I will be creating a simple Settings Commandmenu script that does not need any other files to work properly.

 

Step #1: Identify Commands

Identify what commands you want to use in the GUI menu. Pick out some settings that you will be using in your script and that you think would be beneficial to have in a GUI menu.

 

For this tutorial I will use the "volume" command and the "net_graph" command for the examples.

 

Step #2: Edit Commandmenu.txt (Add Main Menus)

Each Main menu should be laid out in numerical order. Here we will add a menu for our first setting from Step #1 "volume". Since it is our first Main Menu, we will set the "Bound key" to "1" and label the Button Text as "Volume Adjuster".

 

At this time, open up a blank file with Notepad and insert the following text:

 

"1" "Volume Adjuster"

{

 

}

 

Notice the brackets below the text. These must start and end your submenus like bookends. A left bracket is the starting bracket and the right bracket is the ending bracket. If you used this Menu in the game at this point, it would look like this:

 

 

 

Step #3: Edit Commandmenu.txt (Add Settings)

Now that we have added our first main menu "Volume Adjuster", we will add settings for this menu. Here we will input the text within the brackets and remember the standard format:

 

  "Bound Key" "Button Text" "Command sent to server"

 

Now type (cut & paste) the following settings to your file:

 

{

  "1" "Volume Off" "volume 0.0; dev1; echo Volume Muted; dev0"

  "2" "Volume 10%" "volume 0.1; dev1; echo 10% Volume; dev0"

  "3" "Volume 20%" "volume 0.2; dev1; echo 20% Volume; dev0"

  "4" "Volume 30%" "volume 0.3; dev1; echo 30% Volume; dev0"

  "5" "Volume 40%" "volume 0.4; dev1; echo 40% Volume; dev0"

  "6" "Volume 50%" "volume 0.5; dev1; echo 50% Volume; dev0"

  "7" "Volume 60%" "volume 0.6; dev1; echo 60% Volume; dev0"

  "8" "Volume 70%" "volume 0.7; dev1; echo 70% Volume; dev0"

  "9" "Volume 80%" "volume 0.8; dev1; echo 80% Volume; dev0"

  "0" "Volume 90%" "volume 0.9; dev1; echo 90% Volume; dev0"

  "-" "Volume Max" "volume 1.0; dev1; echo Max Volume; dev0"

}

 

Notice that everything is contained in quotes and that each line starts with the "Bound Key", then the text that will be displayed on the button "Button Text", and finally the command that will be executed. Also, note that we inputted the settings within the original brackets. The in-game menu would now look like this:

 

 

 

Step #4: Add Another Main Menu

At this time we will add another Main Menu to our file below the last bracket of the Volume Adjuster menu. This time we will use "2" for the bound key, since "1" is already used, and we will label this menu "Visual Settings". Type the following into your file:

 

"2" "Visual Settings"

{

 

}

 

Step #5: Add a Submenu

 

Now for the first time we will add a menu below the Main menu before adding settings. This would be used if you wanted to organize your main menus into various submenus for ease of use. For example, you might have Main Menu labels for Buys, Settings, and Demos, and then have submenus in each of those that correspond with the main menu.

 

We will add a submenu in the same fashion as we added the main menu,

 

except that we will add this menu within the brackets of the main menu. Here we will label the bound key as "1", since it is the first sub-menu in the "Visual Settings" main menu. We will give this menu a label of "Net Graph Settings". Now you can type the following (in bold) into your file:

 

{

 

      "1" "Net Graph Settings"

      {

 

      }

 

}

 

Notice that I indented the file to keep everything organized and in some sort of tabular format.

 

This is not required, but is a good idea.

 

Step #6: Add Settings

 

Now that we have added our first sub menu "Net Graph Settings" we will add settings

 

for this menu. Here we will input the text within the brackets and remember the standard format:

 

"Bound Key" "Button Text" "Command sent to server"

 

Now type (cut & paste) the following settings (in bold) to your file:

 

{

 

    "1" "Net Graph Off" "net_graph 0"

    "2" "Net Graph 1 On" "net_graph 1"

    "3" "Net Graph 2 On" "net_graph 2"

    "4" "Net Graph 3 On" "net_graph 3"

    "5" "Cancel "slot10"

 

}

 

Notice that I added a cancel option with this menu to close the screen and cancel your choices.

 

At this point your file should look like this:

 

  "1" "Volume Adjuster"

  {

"1" "Volume Off" "volume 0.0; dev1; echo Volume Muted; dev0"

"2" "Volume 10%" "volume 0.1; dev1; echo 10% Volume; dev0"

"3" "Volume 20%" "volume 0.2; dev1; echo 20% Volume; dev0"

"4" "Volume 30%" "volume 0.3; dev1; echo 30% Volume; dev0"

"5" "Volume 40%" "volume 0.4; dev1; echo 40% Volume; dev0"

"6" "Volume 50%" "volume 0.5; dev1; echo 50% Volume; dev0"

"7" "Volume 60%" "volume 0.6; dev1; echo 60% Volume; dev0"

"8" "Volume 70%" "volume 0.7; dev1; echo 70% Volume; dev0"

"9" "Volume 80%" "volume 0.8; dev1; echo 80% Volume; dev0"

"0" "Volume 90%" "volume 0.9; dev1; echo 90% Volume; dev0"

"-" "Volume Max" "volume 1.0; dev1; echo Max Volume; dev0"

  }

  "2" "Visual Settings"

  {

"1" "Net Graph Settings"

{

"1" "Net Graph Off" "net_graph 0"

"2" "Net Graph 1 On" "net_graph 1"

"3" "Net Graph 2 On" "net_graph 2"

"4" "Net Graph 3 On" "net_graph 3"

"5" "Cancel" "slot10"

}

  }

 

 

 

Each menu has a starting and ending bracket to include the submenus. Also, each menu has a "Bound Key" and "Button Text", while the actual settings include a "Bound Key", "Button Text", and the "Command to Server".

 

Step #7: Saving & Moving File

At this time our Commandmenu script is almost complete. Now that you have verified yours is correct, we will save the file. Since the file is a standard txt file, all you have to do is verify your spelling and save the file as:

 

commandmenu.txt

 

Once the file is saved you will want to rename your original commandmenu.txt file that is in your cstrike directory. Once you have renamed it to something like commandmenubak.txt, you can move your newly made one into the cstrike folder.

 

Step #8: Binding the Commandmenu

The final step in creating a Commandmenu script is to bind a key to the command: +commandmenu. This is the command that will open up your Commandmenu script. You have a few options at this time. The first one is to go to your in-game controls menu and bind a key to the "Activate in-game GUI" command. Your other option is to add a bind to your config.cfg or other cfg file like the following:

 

&nbspbind "b" '+commandmenu"

 

That's it! You are ready to go out and try your new Commandmenu Script. Also, you can add more menus and settings as you please to create your own custom Commandmenu Script. Good Luck!

Write comment (0 Comments)

Posted

Topic moved to right section.

 

Be careful, please post your shares in right sections.

 

Also where is the credits? or source?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Bought the interface source for the 557 protocol from him. Everything works as described, no issues so far. Smooth deal, would recommend.
    • Add try version of protocol 563 https://drive.google.com/file/d/1l1QnyFGXxX_c98FNUgXHFmDsIzZCrVc6/view?usp=drive_link
    • WTS Adena Stock 2.6kkk Titan 78 Sub Sagitarius 76 nobless Hirophant 78 Sub Cardinal 78 nobless   discord : nhr0711
    • We are not another "open-close" project. LOE is a long-term Essence server that has been live for over a year — NewAge x2 is our brand-new world, and it will never be wiped. 🗺 STAGED WORLD PROGRESSION Here is what kills most servers: no-lifers hit the cap in three days, everyone else logs in to a finished race. On LOE the world unlocks stage by stage, every ~2 weeks — new locations, new bosses, new gear ceiling. The server grows as one. Start on day one or day ten — you are still in the race. ✨ WHAT MAKES US DIFFERENT Subclass system on Essence — a full dedicated questline, unique for this platform. Your build, your rules. Talent system — three branches: tank, damage, farm. Two players, same class, different characters. Hero skills and deep character customization. Fair progression — power comes from playing, not from a credit card. x2 rates — the classic Essence pace without the grind wall. 📚 WE DOCUMENTED EVERYTHING 25,000+ items, every class with full skill tables, monsters, drop rates, quests, locations. Check the server before you even download it: loe.promo/wiki — no other project gives you this. 📋 SERVER INFO Platform: Lineage 2 Essence · Rates: x2 Open Beta: July 24 — test the stages and the subclass questline before launch Grand Opening: July 31, 20:00 GMT+3 Site & wiki in English — international players welcome 🔒 YOUR NICKNAME IS BEING TAKEN RIGHT NOW Reservation is already open. On the 31st the crowd arrives — the name you have carried through every server for years may simply be gone. Lock it in 30 seconds: Equal start for everyone. See you in Elcardia — July 31, 20:00 GMT+3. Questions? Drop them below — the team reads this thread daily.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..