• Is there a way to attach a command to a button?
    4 replies, posted
I'm trying to create a button that toggles ai_ignoreplayers, and my first thought was to BindToggle it to a key (in this case 'g'), and then have the button simulate pressing that key, but for some reason it didn't work. I know that the key itself works, but the button doesn't. So, I wanted to know if there's a simpler way of going about it, and if I'm missing something important.
You have to put this command in console first to be able to run console command through E2: wire_expression2_concmd 1 And then I guess you could do it like this so you can turn it on and off: @name Console test @inputs Button if(Button==1) {       concmd("ai_ignoreplayers 1")      } else {concmd("ai_ignoreplayers 0")}
It said wire_expression2_concmd 1 was an unknown command when I put it into the console. Also, where do I put that code? Does it also go into the console?
He gave you code for Expression2, which is an extension of WireMod, I don't even know why Something like this probably alias toggle_ai_on "ai_ignoreplayers 1;bind p toggle_ai_off" alias toggle_ai_off "ai_ignoreplayers 0;bind p toggle_ai_on" bind p toggle_ai_on
Thanks!
Sorry, you need to Log In to post a reply to this thread.