Is there a way to bind a key to Disable AI?

Well, I was playing and I was wondering if there was a way to bind a key to the Disable AI button. It would be extremely usefull…

Sorry- Probably a dumbass noob question, but though Id ask…

If you’re admin-

bind “<whatever button>”“ai_disable”

It doesnt work, but I might be doing it wrong.
bind g ai_disable? I even tried it with numbers, but it didnt work.

bind [ “ai_disable 1”
bind ] “ai_disable 0”

[ Disables AI, ] Enables AI.

As far as I know, it’s just “ai_disable” which does the toggle.

You also need cheats enabled.

you type this into the console

sv_cheats 1 <press enter>
bind “g”“ai_disable” <press enter>

I got it to work- I messed up th espacing and the parenthasees. Thanks.

Save you the effort of using lots of commands; bind “[key]” “sv_cheats 1;ai_disable”

I’m pretty sure it’s BindToggle for an on/off command, not plain old bind. As in, typing

BindToggle g "ai_disabled"

will make it toggle ai_disabled every time you press g.