No announcement yet.

simple volume control script

  • Filter
  • Time
  • Show
Clear All
new posts

  • simple volume control script

    We always end up telling someone to type volume xx in console during an HLTV session. I use this simple script to adjust volume in hl mods. It's trivial, but I've done the tedious part for you:

    alias vol10max "echo Max volume level;"
    alias vol10l10 "volume 1 ;echo Volume level: 100; alias vol10up vol10max; alias vol10down vol10l9"
    alias vol10l9 "volume 0.9;echo Volume level: 90; alias vol10up vol10l10; alias vol10down vol10l8"
    alias vol10l8 "volume 0.8;echo Volume level: 80; alias vol10up vol10l9; alias vol10down vol10l7"
    alias vol10l7 "volume 0.7;echo Volume level: 70; alias vol10up vol10l8; alias vol10down vol10l6"
    alias vol10l6 "volume 0.6;echo Volume level: 60; alias vol10up vol10l7; alias vol10down vol10l5"
    alias vol10l5 "volume 0.5;echo Volume level: 50; alias vol10up vol10l6; alias vol10down vol10l4"
    alias vol10l4 "volume 0.4;echo Volume level: 40; alias vol10up vol10l5; alias vol10down vol10l3"
    alias vol10l3 "volume 0.3;echo Volume level: 30; alias vol10up vol10l4; alias vol10down vol10l2"
    alias vol10l2 "volume 0.2;echo Volume level: 20; alias vol10up vol10l3; alias vol10down vol10l1"
    alias vol10l1 "volume 0.1;echo Volume level: 10; alias vol10up vol10l2; alias vol10down vol10l0"
    alias vol10l0 "volume 0.0;echo Volume level: 0; alias vol10up vol10l1; alias vol10down vol10min"
    alias vol10min "echo Min volume level;"

    echo "Using 10-level volume control"
    alias volumeup vol10up
    alias volumedown vol10down
    You need to run the alias at a default volume to start at and bind some keys to volumeup and volumedown. I have this:

    echo "Defaulting to volume level .2"

    bind "PGUP" "volumeup"
    bind "PGDN" "volumedown"

  • #2
    Re: simple volume control script

    You may want to actually display the echo messages to the screen. I've said it before, and I'll say it again: this is how you can do that.

    developer 1; motdfile echo.txt; motd_write _____Volume: xx%; motd; developer 0
    The five underscores space the text over if you have cl_showfps 1 on. You don't need them if you normally have cl_showfps 0.


    • #3
      Re: simple volume control script

      heh, this script predates motd and even ns. Back in my day, all you needed was developer 1 and echo :). So those weren't intended to print right to the screen, just to print when developer mode was on, and to be quiet when it wasn't.

      As it is, I've never seen fit to change it, it's pretty trivial.




      TeamSpeak 3 Server




      Twitter Feed