[Script]Two keypad configs, which can be switched at the press of a button

Discussion in 'Team Fortress 2' started by Bunnie_Lord, Aug 22, 2014.

Thread Status:
Not open for further replies.
  1. Bunnie_Lord

    Bunnie_Lord Member

    Joined:
    Aug 27, 2012
    Messages:
    752
    Likes Received:
    128
    Steam:
    Steam SteamRep
    Hello people, I've created a script for myself so that I have 2 different functions assigned to my keypad buttons, which can be switched between by pressing a separate button. I've created 2 options, namely you have to press the button once to switch binds, or you have to hold the button to switch to binds, when you release the button the old binds are configured again.

    Press to switch:
    Code:
    //Keypad Multi
    alias "keypad1" "exec kp1.cfg; alias kpsw keypad2"
    alias "keypad2" "exec kp2.cfg; alias kpsw keypad1"
    keypad1
    bind pgdn "kpsw"
    Push-to-switch:
    Code:
    //Keypad Multi
    alias "+multi" "exec kp2.cfg"
    alias "-multi" "exec kp1.cfg"
    bind pgdn "+multi"
    exec kp1.cfg
    
    As you see, you'll need 2 separate config files to bind the buttons, because Source scripting is not able to call functions/binds in the same script. I use kp1.cfg and kp2.cfg to configure the keypad buttons, and page down to switch between them. The first code can have more configs than just 2, just remember you'll have to keep track of the "page" yourself.

    Have fun with it.
     
  2. Ruby

    Ruby Member

    Joined:
    Sep 3, 2014
    Messages:
    99
    Likes Received:
    8
    Steam:
    Steam SteamRep
    Thats sosoooooooo cool
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.