Binding several commands to one button

Guides and how to's on anything related to JK2, whether it's about modding or in-game topics.
Post Reply
User avatar
Posts: 954
Joined: 24 Feb 2015, 08:21

Binding several commands to one button

Post by Boothand » 22 Aug 2015, 10:10

I (more or less) recently figured out a way to bind a series of things to a button. The trick is to use quotation marks.
Say you were testing something on your server and every time you spawn, you want to teleport to a certain location, give yourself 999 armor and 1 health.

Here's an example: (type these in the console)

bind o "setviewpos 892 -1486 28 90; give armor 999; give health 1;"

Without quotation marks, only the first command would be executed.

For taking screenshots, for example, using wait commands may be necessary to make it happen in the correct frame.

bind n "cg_draw2d 0; cg_shadows 3; wait 5; screenshot; cg_draw2d 1; cg_shadows 1;"

User avatar
Posts: 789
Joined: 23 Feb 2015, 13:05

Re: Binding several commands to one button

Post by Daggolin » 22 Aug 2015, 10:30

This is actually not known by many players I think. Nice to have this posted somewhere. ;)

User avatar
Posts: 581
Joined: 23 Feb 2015, 13:03
Location: Gliese581c

Re: Binding several commands to one button

Post by ouned » 22 Aug 2015, 10:57

jk2's scripting system is pretty powerful. you can even get some logic out of it using "set" "vstr" and cvars.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests

Created by Matti from and Warlords of Draenor (modified by
Powered by phpBB® Forum Software © phpBB Limited