detecting if a player presses a key
Is there any way we can detect if a player has pressed a key (for example f) without slowhacking?
fyi, just curious: why is that slowhacking? if we can detect if a player has pushed tab or use then why would detecting a random key (eg: f) be slowhacking? what if we would check first if a key (eg: f) has been binded to something by the player. if he has binded something to that we do not continue with linking a function to it. but if he hasnt binded something to that key then we continue linking a function to the key (in the plugin only) so that the server never binds something to that key for that player so if he leaves nothing has been changed in his keyboard settings. would that still be slowhacking? |
Re: detecting if a player presses a key
no it wont.
PHP Code:
PHP Code:
|
Re: detecting if a player presses a key
You can't check if the user has binded a command to a key and you can't restore his bind after changing it, so it's slowhacking, unless you don't do it with the user's agreement (like menu asking if he wants it to be changed).
|
Re: detecting if a player presses a key
Quote:
This has been asked a million times and the answer hasn't changed. |
Re: detecting if a player presses a key
Quote:
Quote:
Quote:
could you explain the get_uc and set_uc native a lil better via this block? the info in the funcwiki is everything but usefull |
Re: detecting if a player presses a key
static is irrelevant to how the code works. There are posts that explain static vs new. In this case, it is mostly an efficiency thing.
buttons contains a bitwise list of the commands that are active basically. You should explain exactly what you are trying to do because your suggestion in your first post is not possible. |
Re: detecting if a player presses a key
A question: where can I find these defines: IN_SCORE, IN_ATTACK elc..?
Edit: Found it. ITs in hlsdk_const.inc |
Re: detecting if a player presses a key
Quote:
how I want to use this: In the nightcrawler mod from nikhilgupta345, Players have to bind a key to "item" first before they can use items and teleport as NC. I want to ask the player when they join to let the server do it for them. If they choose yes the server has to bind it for the player. if they choose no then they have to bind it themselves to a key of their choice. do you think it can be done without slowhacking? if anyone know a better nightcrawler mod i'd love to take a peek. This one is hard to read and not very user friendly, but im not complaining, its a good mod :) |
Re: detecting if a player presses a key
Use autobind plugin.
|
Re: detecting if a player presses a key
wow would you look a that, never expected that that would have an approved plugin, awesome.
thanks for pointing that out connor :up: |
| All times are GMT -4. The time now is 00:21. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.