Jump to content

Is it possible to set up if statements/store variables in CS:GO console?

I would like to use my num pad for keybinds in csgo and I would like to be able to press a button to switch the keybinds from guns in competitive to moving bots and stuff in a test server. To do that I think the easiest way would be to save a boolean variable then use an if statement to detect it and rebind the numpad based on which it is on, then change the variable. The other option would be to have 2 separate buttons for rebinding, but I would like to use only 1.

Link to comment
Share on other sites

Link to post
Share on other sites

21 minutes ago, Cheeseman54703 said:

I would like to use my num pad for keybinds in csgo and I would like to be able to press a button to switch the keybinds from guns in competitive to moving bots and stuff in a test server. To do that I think the easiest way would be to save a boolean variable then use an if statement to detect it and rebind the numpad based on which it is on, then change the variable. The other option would be to have 2 separate buttons for rebinding, but I would like to use only 1.

Easier way is to create a config file in the CSGO folder containing the new keybinds then use the exec console command to execute the new config from in game. To swap back just exec the default game config.

 

Or just use sourcemod...

Main Rig:-

Ryzen 7 3800X | Asus ROG Strix X570-F Gaming | 16GB Team Group Dark Pro 3600Mhz | Corsair MP600 1TB PCIe Gen 4 | Sapphire 5700 XT Pulse | Corsair H115i Platinum | WD Black 1TB | WD Green 4TB | EVGA SuperNOVA G3 650W | Asus TUF GT501 | Samsung C27HG70 1440p 144hz HDR FreeSync 2 | Ubuntu 20.04.2 LTS |

 

Server:-

Intel NUC running Server 2019 + Synology DSM218+ with 2 x 4TB Toshiba NAS Ready HDDs (RAID0)

Link to comment
Share on other sites

Link to post
Share on other sites

19 minutes ago, Cheeseman54703 said:

I would like to use my num pad for keybinds in csgo and I would like to be able to press a button to switch the keybinds from guns in competitive to moving bots and stuff in a test server. To do that I think the easiest way would be to save a boolean variable then use an if statement to detect it and rebind the numpad based on which it is on, then change the variable. The other option would be to have 2 separate buttons for rebinding, but I would like to use only 1.

Use a website.

or do alias bind1 xxxxx

then do bind numpadX bind1

Link to comment
Share on other sites

Link to post
Share on other sites

8 hours ago, Dan Castellaneta said:

I'm fairly sure it's simpler than that with CS; you should be able to do bind [key] "[action]"

I'm not sure if parentheses are needed, though.

 

7 hours ago, Master Disaster said:

Easier way is to create a config file in the CSGO folder containing the new keybinds then use the exec console command to execute the new config from in game. To swap back just exec the default game config.

 

Or just use sourcemod...

I understood how to do those things already but wanted something simpler.

 

7 hours ago, Firewrath9 said:

Use a website.

or do alias bind1 xxxxx

then do bind numpadX bind1

After looking into this I can see it is exactly what I wanted. Thank you.

Link to comment
Share on other sites

Link to post
Share on other sites

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

×