Use Key Command
I want to make so when a player presses their use key or E then it executes a function like a normal command. The problem is when I registered +use as a command it wouldn't work. I know there is a way around this because I have seen it done on multiple servers. I don't care if it does it with +use or when the player presses the E key. I just want to know how.
|
Re: Use Key Command
Code:
new buttons = get_user_button(id) |
Re: Use Key Command
Thanks.
|
Re: Use Key Command
Actually it's necessary to check oldbuttons too:
Quote:
|
Re: Use Key Command
Hi there,
im working on an updated Diablomod and want to know how and if its possible to put a "menu" to a Key like Use. I want to set F1 or F2...and so on as menu key, i hope you understand. Here's a little bit of the code in client_prethink: Code:
Code:
Can you guys help me please? Thanks in advance ^^ Regards* |
Re: Use Key Command
You can't detect the key that a player is pressing, only the bind that it is bound to.
So, you aren't really detecting the pressing of the use key, you are detecting the execution of "+use". |
Re: Use Key Command
So i could detect for example the "snapshot" key for this menu right?
|
Re: Use Key Command
Yes, but not with pev(index, pev_button).
You will have to register the command. |
Re: Use Key Command
Quote:
What keys / actions from the client could i use that arent used often in cs but bound to a key? I hope you understand what i mean... BTW its already registered thats not the problem ^^ *register_clcmd("menu","showmenu")* |
Re: Use Key Command
Just show them a menu when they join asking them if they want their [key] changed to [bind].
And if yes, change it. |
| All times are GMT -4. The time now is 06:54. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.