General > Off-Topic

Lua Command to bind Console Commands?

(1/1)

Aqua92:
Hey Ulysses User/Team and so on :)
I have a little Problem. I need an LUA command for gmod, Half Life CS:S and so on.

It should do the follow thing:
When i press mouse4 (i guess its mouse4) then it should do type the following to the console
"bind "mousewheel_up" "jump""

and when i press it again it should do
"bind "space" (dont know if the button called space. just the " ") "jump" like unbinding from mousewheel

So while Playing: i press the mouse4 button. Then i jump with the Mousewheel. I press it again then i jump with Space again.

Im a Lua noob. so i cant do it on my own. i can read lua but not write :/ to much in practice with c++. no time for lua.

I hope you can help me :)

Aqua

Megiddo:
You can do this from a config, no lua required. I'll try to remember how after class..

lavacano201014:

--- Code: ---alias "WheelJump_ON" "unbind space;bind mwheelup +jump;alias WheelJumpToggle WheelJump_OFF"
alias "WheelJump_OFF" "unbind mwheelup;bind space +jump;alias WheelJumpToggle WheelJump_ON"
WheelJump_OFF
bind "mouse4" "WheelJumpToggle"
--- End code ---

Whenever you start whatever game you plug that cfg into, it will start with Space as your jump key. Not sure those are the right keys though.

Navigation

[0] Message Index

Go to full version