Author Topic: Volume Up/Down Bind  (Read 2098 times)

Zorchenhimer

  • Autococker
  • Posts: 2614
Volume Up/Down Bind
« on: February 03, 2008, 02:12:30 PM »
Upon request, I made a bind to change the ingame volume.  By default Up is F4 and Down is F3.

Code: [Select]
bind F3 "volume6" //down
bind F4 "volume8" //up
bind F5 "mute"

set s_volume "0.7"

alias "mute" "s_volume 0; echo mute"
alias "volume0" "s_volume 0; bind F4 volume1; echo volume0"
alias "volume1" "s_volume 0.1; bind F3 volume0; bind F4 volume2; echo volume1"
alias "volume2" "s_volume 0.2; bind F3 volume1; bind F4 volume3; echo volume2"
alias "volume3" "s_volume 0.3; bind F3 volume2; bind F4 volume4; echo volume3"
alias "volume4" "s_volume 0.4; bind F3 volume3; bind F4 volume5; echo volume4"
alias "volume5" "s_volume 0.5; bind F3 volume4; bind F4 volume6; echo volume5"
alias "volume6" "s_volume 0.6; bind F3 volume5; bind F4 volume7; echo volume6"
alias "volume7" "s_volume 0.7; bind F3 volume6; bind F4 volume8; echo volume7"
alias "volume8" "s_volume 0.8; bind F3 volume7; bind F4 volume9; echo volume8"
alias "volume9" "s_volume 0.9; bind F3 volume8; bind F4 volume10; echo volume9"
alias "volume10" "s_volume 1.0; bind F3 volume9; echo volume10"

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Volume Up/Down Bind
« Reply #1 on: February 03, 2008, 03:52:55 PM »
cvar_inc is your friend.

Garrett

  • Autococker
  • Posts: 1372
Re: Volume Up/Down Bind
« Reply #2 on: February 03, 2008, 03:58:08 PM »
Upon request, I made a bind to change the ingame volume.  By default Up is F4 and Down is F3.

Code: [Select]
bind F3 "volume6" //down
bind F4 "volume8" //up
bind F5 "mute"

set s_volume "0.7"

alias "mute" "s_volume 0; echo mute"
alias "volume0" "s_volume 0; bind F4 volume1; echo volume0"
alias "volume1" "s_volume 0.1; bind F3 volume0; bind F4 volume2; echo volume1"
alias "volume2" "s_volume 0.2; bind F3 volume1; bind F4 volume3; echo volume2"
alias "volume3" "s_volume 0.3; bind F3 volume2; bind F4 volume4; echo volume3"
alias "volume4" "s_volume 0.4; bind F3 volume3; bind F4 volume5; echo volume4"
alias "volume5" "s_volume 0.5; bind F3 volume4; bind F4 volume6; echo volume5"
alias "volume6" "s_volume 0.6; bind F3 volume5; bind F4 volume7; echo volume6"
alias "volume7" "s_volume 0.7; bind F3 volume6; bind F4 volume8; echo volume7"
alias "volume8" "s_volume 0.8; bind F3 volume7; bind F4 volume9; echo volume8"
alias "volume9" "s_volume 0.9; bind F3 volume8; bind F4 volume10; echo volume9"
alias "volume10" "s_volume 1.0; bind F3 volume9; echo volume10"
You don't paste this in the console right?

Cobo

  • Autococker
  • Posts: 1362
Re: Volume Up/Down Bind
« Reply #3 on: February 03, 2008, 04:00:29 PM »
Yep, using cvar_inc is way easier. I believe I made an example of a volume script using it a while ago.

Zorchenhimer

  • Autococker
  • Posts: 2614
Re: Volume Up/Down Bind
« Reply #4 on: February 03, 2008, 07:17:31 PM »
cvar_inc is your friend.

Haha. Wow, forgot about that.  :P

coLa

  • Autococker
  • Posts: 1178
Re: Volume Up/Down Bind
« Reply #5 on: February 04, 2008, 01:54:29 PM »
i tried just using "inc" now i know to add a cvar_ in front. :D