Re: [SNIPPET] Detecting button presses (and releases)
Quote:
|
Re: [SNIPPET] Detecting button presses (and releases)
True, but since this is the Snippets and Tutorials section and many newcommers take code from here I suggest that such bad habits like defining variables inside loops would be avoided. No static needed, the best thing would be to declare the variable outside the loop.
|
Re: [SNIPPET] Detecting button presses (and releases)
What makes you think that "defining a variable inside a loop" is a bad habit????
|
Re: [SNIPPET] Detecting button presses (and releases)
After some research on the internet I found that I'm wrong about the variables. Somehow I thought it would be inefficient. :)
|
Re: [SNIPPET] Detecting button presses (and releases)
Is there a way to hook other buttons that are not on the list? To be specific, I'm trying to hook lastinv or slot1 key presses.
|
Re: [SNIPPET] Detecting button presses (and releases)
Quote:
|
Re: [SNIPPET] Detecting button presses (and releases)
I've found a bit of a sexier way of doing this, just have to get m_afButtonReleased and m_afButtonPressed data props
These variables store the buttons released/pressed that frame, or 0 if nothing was released/pressed |
Re: [SNIPPET] Detecting button presses (and releases)
Quote:
|
Re: [SNIPPET] Detecting button presses (and releases)
PHP Code:
PHP Code:
|
| All times are GMT -4. The time now is 23:23. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.