Raised This Month: $ Target: $400
 0% 

Solved Detect firing for x seconds?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-12-2018 , 15:15   Re: Detect firing for x seconds?
Reply With Quote #1

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.
__________________
fysiks is offline
sekac
Senior Member
Join Date: Nov 2016
Old 05-12-2018 , 15:19   Re: Detect firing for x seconds?
Reply With Quote #2

Quote:
Originally Posted by fysiks View Post
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.
I think I will set a task when a player starts holding IN_ATTACK and remove the task when he releases it. That way I don't have to calculate how long the user has been holding the attack key.
sekac is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:37.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode