Hey Guys,
I want to make new Killstreaks on my Mod, but I only can do by pressing F or Bash calling scripts.
I want to have more buttons, is there possible to use the keys 3,4,5,6,7...?
Printable View
Hey Guys,
I want to make new Killstreaks on my Mod, but I only can do by pressing F or Bash calling scripts.
I want to have more buttons, is there possible to use the keys 3,4,5,6,7...?
Just like I posted in this thread: http://killtube.org/showthread.php?1702-key-on-keyboard
You can use any keys, like instead of k you can use your 1, 2, 3, 4 numbers, but bare in mind that you should keep the response like "key_1" instead of just "1" so that it doesn't interfere with anything else.
PS. Remmember about binding those keys every respawn so that the player will not unbind them, it's much better then making a new loop to open that menu file.
Hehe, just bougth a new PC, so I'am gonna start to play on your Modern Weapons 1.2
Can you do an example for the menu? What should be there?
Yeah, I'll post one when I'am back home, just give me an hour please.
It's the clientcmd menu, renamed to keys.menu. I personally think it is a waste of resources to have 2 menus which do the same thing, so I would change the key binding to this instead:
And use the clientcmd.menu to force the key binding.Code:bind k "openscriptmenu clientcmd key_K"
Yeah agree with Tally.PHP Code:#include "ui_mp/menudef.h"
{
menuDef
{
name "clientcmd"
rect 0 0 1 1
visible 0
fullscreen 0
onOpen
{
exec "vstr clientcmd";
bind k "openscriptmenu clientcmd key_K"
close clientcmd;
}
}
}
Ok, I will try it, and thanks!
Ah and I can do here more keys? As example K,L,M,N...?
Yes, you can. But, make sure you don't go crazy with it, and remember not to use keys which most players use to control the avatar. I would hate to have a mod re-bind those keys to some mod function. I tend to use keys which aren't used in the game, such as L, K, J, I, O, P. These are right over on the right-hand side of the keyboard, and are not used very much by gamers.
Should it work it so?
And the menu name should be clientcmd.menu?Code:#include "ui_mp/menudef.h"
{
menuDef
{
name "clientcmd"
rect 0 0 1 1
visible 0
fullscreen 0
onOpen
{
exec "vstr clientcmd";
bind k "openscriptmenu clientcmd key_K"
bind l "openscriptmenu clientcmd key_L"
bind m "openscriptmenu clientcmd key_M"
bind n "openscriptmenu clientcmd key_N"
close clientcmd;
}
}
}
Edit: I will be crazy. My friend and me don't understand it, can you please upload here all things what there should be in (the menu file, _menus.gsc ..), better then ask here 1000 things?
Sorry for long response I was just unaware you didn't get an answer, so here you go:
Create a menu just like you said clientcmd.menu and put the stuff you got in it.
Then somewhere in your gametype script preferably on connect and on spawn so that it binds the keys if someone removes them:
And again don't forget to precache your menu somewhere in your init gametype function like:PHP Code:self closeMenu();
self closeInGameMenu();
self openMenu(game["clientcmd"]);
Finally add if(menu == "-1" && response == "key_K") in your menu gsc file and your actual thread to the script.PHP Code:game["clientcmd"] = "clientcmd";
precacheMenu(game["clientcmd"]);