Detect firing for x seconds?
How can I call a function after a user has been firing from a gun for more than 2 seconds? The timer should reset when the player lets go of mouse 1.
|
Re: Detect firing for x seconds?
Probably need to detect the IN_ATTACK button and calculate how long it is active. If more than 2 seconds, call your function. There are several threads around here that show how to check when IN_ATTACK is pressed and released.
|
Re: Detect firing for x seconds?
Quote:
|
Re: Detect firing for x seconds?
Do you want it to continually call your function after the user has been holding the key for longer than 2 seconds, or only call it once, then repeat the whole process after the user releases the button and starts holding it again?
|
Re: Detect firing for x seconds?
Hook cmdstart check if user pressing attack and its old button, then execute the function you wanted depends on the gametime.
|
Re: Detect firing for x seconds?
Quote:
|
Re: Detect firing for x seconds?
Quote:
|
Re: Detect firing for x seconds?
Quote:
PHP Code:
|
Re: Detect firing for x seconds?
There is abetter way you can use and what forward you used to check the attack?
|
Re: Detect firing for x seconds?
Quote:
|
| All times are GMT -4. The time now is 04:37. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.