Create a +button
How does one go about creating a new +button in an amxx plugin and be able to detect when it is being pressed?
|
Re: Create a +button
for custom buttons:
PHP Code:
PHP Code:
PHP Code:
|
Re: Create a +button
You sure something that simple works? It looks like that would just call the function once when the button is pressed, not call it continuously as the button is held down, like the game's +buttons: +attack, +duck, etc.
I saw a jetpack plugin on here once (can't find it now :() that had a module included to add a +jetpack button. I'm thinking it may be more complicated than what you've suggested, unless you can convince me otherwise. Trying it now -- will get back to you, sonny boy! Back: Sorry, it doesn't work as intended. It just calls the function once per press/hold. It does not have a hold/release like real hl +buttons. |
Re: Create a +button
Just save in some variable that user is holding a button and check it every time when you need/want. Jatpack is just using playerprethink:
PHP Code:
PHP Code:
Anyway, if you wanna reapeat the function just use playerprethink (althow I'm not recomending to do that, cuz of the fps + cl_cmdrate, but ...) just use some loop function... it isn't hard. |
Re: Create a +button
|
| All times are GMT -4. The time now is 09:05. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.