Jump to content

[Tutorial]CommandMenu Script


Grim.

Recommended Posts

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)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Telegram : https://t.me/ultrastore11
    • Has anyone use their services?Their website looks super fishy.
    • Two Factions , An Endless War. Which Side Will You Choose? The legendary faction server, that everyone was waiting for, Koofs Vs Noobs is back! 24 hours pvp , no farm , fascinating rotating pvp zones! Koof vs Noob will fight each other day and night in order to gain their lost respect! Are you ready to feel the excitement? Rates: * EXP/SP x9999 * Faction Server   General Rates: * Start up Player System Instant LvL 80 * Choose For What Faction You Love To Fight [Koofs - Noobs] * Koofs Base: Dark Elf Village * Noobs Base: Elven Village * Prepare You Character Scheme Buff Or Choose Auto Buff * PrePare Your Character Equipment From KvN Shop * Killing spree systems * Full GM shop. * Free class change and Subclass * All NPCs available in town. * Custom Items Balanced. * Community Board BugReport/RaidInfo/TopPvP-Online 1 PvP = 1 Adena (2 If Premium)   Enchant Rates: Safe Enchant +6 Max Enchant +21 Normal Scroll Chance: 100% (+0 to +6) Blessed Scroll Chance: 85% (+6 to +21) Ex: If +14 failed for +15, return +14 LifeStones Rates: High Lifestone Chance: 5% Top  Lifestone Chance: 10%   Faction Bosses: Lilith Koofs Respawn 3H +1Random(there is a chance to spawn in 2H or 4H) Drops Adena+Bless Anakim Noobs Respawn 3H +1Random(there is a chance to spawn in 2H or 4H) Drops Adena+Bless   Grand Bosses: Queen Ant 8H +1Random (there is a chance to spawn in 7H or 9H) Drops RB Ring/LS/BOGS Baium     8H +1Random (there is a chance to spawn in 7H or 9H) Drops RB Ring/LS/BOGS Zaken     8H +1Random (there is a chance to spawn in 7H or 9H) Drops RB Ring/LS/BOGS Antharas  8H +1Random (there is a chance to spawn in 7H or 9H) Drops RB Ring/LS/BOGS Valakas   8H +1Random (there is a chance to spawn in 7H or 9H) Drops RB Ring/LS/BOGS      KvN Maps: Rune Castle Gludin Town   Website: Coming Soon Discord: https://discord.gg/8gmAcjEgFw Beta: 12/8/24 Join in discord group for more information New discord link: https://discord.gg/unn2XBhwef please mods update it because i cant edit my topic.
    • Classic-Interluede  Based on L2off Platform server files  and played with modern game client. Our main goal is to provide our players a fair and  stable retail game environment with less bugs possible and no pay to win game!   Phaedra Opening  :31.08.2024 20:00utc +1 No pay to win                 No Wipe             No Bots Phaedra Server Rates 𝐓𝐚𝐤𝐢𝐧𝐠 𝐢𝐧𝐭𝐨 𝐚𝐜𝐜𝐨𝐮𝐧𝐭, 𝐭𝐡𝐚𝐭 𝐰𝐞 𝐮𝐬𝐞 𝐨𝐟𝐟𝐢𝐜𝐢𝐚𝐥 𝐩𝐭𝐬 𝐢𝐧𝐭𝐞𝐫𝐥𝐮𝐝𝐞 𝐟𝐢𝐥𝐞𝐬, 𝐭𝐡𝐞 𝐠𝐚𝐦𝐞 𝐢𝐬 𝐫𝐞𝐭𝐚𝐢𝐥 𝐰𝐢𝐭𝐡 𝐬𝐨𝐦𝐞 𝐢𝐦𝐩𝐫𝐨𝐯𝐞𝐦𝐞𝐧𝐭𝐬 𝐛𝐫𝐨𝐮𝐠𝐡𝐭 𝐭𝐨 𝐨𝐮𝐫 𝐛𝐞𝐥𝐨𝐯𝐞𝐝 𝐢𝐧𝐭𝐞𝐫𝐥𝐮𝐝𝐞 𝐜𝐡𝐫𝐨𝐧𝐢𝐜𝐥𝐞 𝐬𝐮𝐜𝐡 𝐚𝐬 𝐚𝐭𝐭𝐞𝐧𝐝𝐚𝐧𝐜𝐞 𝐬𝐲𝐬𝐭𝐞𝐦, 𝐦𝐚𝐢𝐥 𝐬𝐲𝐬𝐭𝐞𝐦, 𝐭𝐡𝐞 𝐩𝐨𝐬𝐬𝐢𝐛𝐢𝐥𝐢𝐭𝐲 𝐭𝐨 𝐥𝐞𝐚𝐫𝐧 𝐬𝐤𝐢𝐥𝐥𝐬 𝐟𝐫𝐨𝐦 𝐭𝐡𝐞 𝐬𝐤𝐢𝐥𝐥 𝐩𝐚𝐧𝐞𝐥 (𝐚𝐥𝐭+𝐤) 𝐚𝐧𝐝 𝐚𝐥𝐬𝐨 𝐭𝐨 𝐞𝐧𝐜𝐡𝐚𝐧𝐭 𝐭𝐡𝐞𝐦 𝐚𝐧𝐝 𝐬𝐨 𝐨𝐧. 𝐀𝐬 𝐰𝐞𝐥𝐥 𝐚𝐬 𝐭𝐡𝐞 𝐩𝐨𝐬𝐬𝐢𝐛𝐢𝐥𝐢𝐭𝐲 𝐨𝐟 𝐮𝐬𝐢𝐧𝐠 𝐭𝐡𝐞 𝐧𝐞𝐰 𝐚𝐧𝐝 𝐦𝐨𝐝𝐞𝐫𝐧 𝐜𝐥𝐢𝐞𝐧𝐭 (𝐜𝐥𝐚𝐬𝐬𝐢𝐜 𝐜𝐥𝐢𝐞𝐧𝐭) 𝐰𝐡𝐢𝐜𝐡 𝐨𝐟𝐟𝐞𝐫𝐬 𝐛𝐞𝐭𝐭𝐞𝐫 𝐠𝐫𝐚𝐩𝐡𝐢𝐜𝐬, 𝐦𝐚𝐧𝐲 𝐨𝐟 𝐭𝐡𝐞 𝐬𝐤𝐢𝐥𝐥𝐬 𝐡𝐚𝐯𝐞 𝐧𝐞𝐰 𝐚𝐧𝐢𝐦𝐚𝐭𝐢𝐨𝐧𝐬 𝐚𝐧𝐝 𝐬𝐨 𝐨𝐧.   🔸Exp/SP-3x 🔸Adena -2x 🔸Spoil -1x 🔸Drop -1x 🔸Quests-1x 🔸Manor -1x 🔸Seal Stones -x1 Other Information 🔸Two(2) game clients per ip. 🔸35 sec spawn protection 🔸Buff slots:20+4 🔸Retail Buff Duration:20mins Buffs ,5mins Pow/cov summon buffs, 2 mins Dances/Songs 🔸No Auto Learn Skills 🔸No Auto Pick up Items Donate coin and Vote coin cannot be sold/drop/trade/destruct, but you can store them in your warehouse. 🔸Skills Require spell books to be lerned (alt+k) 🔸You Can Delevel up to 8 Lvls To Keep The Skills 🔸ALT+K to enchant your skills (Require SP+Book of giants) 🔸Safe Enchant: Weapons:+3 /Armors +3 ,Fullbody Armor +4 🔸Enchant Rate: Magic Weapons:From +0 to +3: 100 % - +3 to +15: 40 % - From +15 to +16: 20 % 🔸Enchant Rate: Fighter Weapons:From +0 to +3: 100 % - From +3 to +15: 70 % - From +15 to +16: 35 % 🔸Enchant Rate: Armor:From +0 to +3: 100 %-From +3 to +4: 66.6 %-From +4 to +5: 33.3 % - From +5 to +6: 25 % - From +6 to +7: 20 % - From +7 to +8: 16.6 % - From +8 to +9: 14.2 % - From +9 to +10: 12.5 % 🔸Augument: One active*One Passive 🔸Augument Rate To Get Skill : Top LS-14%;High LS-10%;Mid LS-6%; Normal LS-1% 🔸The quest "Kamel window to the feature" is disabled. 🔸Cursed weapons are disabled till first server heros. 🔸Olympiad will start when there are minimum 40 players nobless. 🔸Wedding system is disabled for now (will be actived later on) . 🔸Clan hall rent fee per week was increased with 300% for better server economy in late game. 🔸Shadow weapons B grade ,shadow weapons C and D are moved to ShadowWeapon Manager( will be in each town and village!) 🔸Adventurer's Guide (Miss Queen) is Spawned in all towns and villages and works retail like. 🔸Class-option to advance your class job with (1st,2nd) class change ticket. option to trade your shadow weapon tickets after you complete you class advancing (D, C grade tickets) like retail. an option to buy change class ticket with adena and donation coins. 🔸Chance to update soul crystal lvl to Anakazel Rift Raid Boss is 25%(retail value). 🔸Quest Enhance weapon is required to lvl up soul crystals. 🔸You need to have in your inventory just 1 (one) soul crystal to be able to lvl it up. 🔸To lvl soul crystals in Pi(Primeval isle) is not required to hit Tyrannosaurus with soul crystal to capture his soul to lvl soul crystal up. 🔸Party Lvl Gap to gain experience is 14 lvls Difference: 💠1 lvl Difference ~98% 💠2 lvl Difference ~95% 💠3 lvl Difference ~93% 💠4 lvl Difference ~91% 💠5 lvl Difference ~88% 💠6 lvl Difference ~86% 💠7 lvl Difference ~83% 💠8 lvl Difference ~81% 💠9 lvl Difference ~78% 💠10 lvl Difference ~23% 💠11 lvl Difference ~22% 💠12 lvl Difference ~21% 💠13 lvl Difference ~20% 💠14 lvl Difference ~19% 💠15 lvl Difference ~ 0% 🔸XP bonus. The more people in a party, the more XP bonus: 💠2 party members — x1.6 💠3 party members — х1.65 💠4 party members — х1.7 💠5 party members — х1.8 💠6 party members — х1.9 💠7 party members — х2.0 💠8 party members — х2.1 💠9 party members — х2.2 🔸Reward for logging into the game daily. 🔸Vote Reward System(12h Bonus rune will increase your Exp, adena, sp, spoil, drop by 15%.) 🔸Stream Reward 🔸Our donation curency is Donate coins with donation coins you can only buy: -5€-Bonus rune 30days will increase your Exp, adena, sp, spoil, drop by 15%. -10€-Costume Ticket (.dressme)-has no bonus just for look. -5€-Hats-has no bonus just for look. -5€-Title Color -8€-World Chat Card-Your Messeges would be seen by everyone. -5€-1st class transfer tiket./-10€-2nd class transfer tiket. -9€-Clan Quest item for clan LVL4. -10€-Clan Quest item for clan LVL5. -5€- Epic Raid boss Join quest -25€- Unique Cloaks -3€- Delete Karma -10€- Delete PK Counter 🔸Alt+click on Buff to remove it !(if you want to remove a buff, don't work to remove your debuffs). 🔸ALT+K For Skill Panel (To Learn Skills or To Enchant skills) 🔸Drop/Spoil shift+click on mob to see he's info. 🔸To Stop Gain experience (.exp on) and to gain experience(.exp off) 🔸Set an character in sell/buy mode and exit game (offlineshop) 🔸Captcha system by killing monsters(150) to pop up,for better security Website: https://classic-interlude.com Discord : https://discord.com/invite/gBUdDPufwE FaceBook https://www.facebook.com/L2ClassicInterlude
  • Topics

×
×
  • Create New...