Raised This Month: $ Target: $400
 0% 

Hooking player actions (+reload, +attack2, etc)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-07-2014 , 15:13   Re: Hooking player actions (+reload, +attack2, etc)
Reply With Quote #1

Quote:
Originally Posted by vman315 View Post
Why not do a case switch?
Because buttons is a bitfield not an enum.

Incidentally, to track when a person presses or lets go of IN_ATTACK2, you're going to have to track what it was on the previous OnPlayerRunCmd as it fires continually as long as the player is doing things.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 04-07-2014 at 15:14.
Powerlord is offline
captaindeterprimary
AlliedModders Donor
Join Date: Sep 2012
Old 04-07-2014 , 17:23   Re: Hooking player actions (+reload, +attack2, etc)
Reply With Quote #2

Quote:
Originally Posted by Powerlord View Post
Because buttons is a bitfield not an enum.

Incidentally, to track when a person presses or lets go of IN_ATTACK2, you're going to have to track what it was on the previous OnPlayerRunCmd as it fires continually as long as the player is doing things.
Huh, I didn't know this.
__________________
Last edited by ; Today at 08:20 AM. Reason: Get rid of s
captaindeterprimary 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 13:11.


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