Raised This Month: $ Target: $400
 0% 

different


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Vechta
Veteran Member
Join Date: Jun 2010
Old 07-31-2010 , 11:43   different
Reply With Quote #1

whats the diffrent between

Code:
get_user_button(id)
and
Code:
get_user_oldbutton(id)
?
Vechta is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-31-2010 , 11:55   Re: different
Reply With Quote #2

button = button player holding in current frame
oldbutton = button player was holding in previous frame

button && oldbutton = player holding button
button && !oldbutton = player pressed button (not holding)
!button && oldbutton = player released button

For use with
Code:
#define IN_ATTACK                       (1<<0)
#define IN_JUMP                         (1<<1)
#define IN_DUCK                         (1<<2)
#define IN_FORWARD                      (1<<3)
#define IN_BACK                         (1<<4)
#define IN_USE                          (1<<5)
#define IN_CANCEL                       (1<<6)
#define IN_LEFT                         (1<<7)
#define IN_RIGHT                        (1<<8)
#define IN_MOVELEFT                     (1<<9)
#define IN_MOVERIGHT                    (1<<10)
#define IN_ATTACK2                      (1<<11)
#define IN_RUN                          (1<<12)
#define IN_RELOAD                       (1<<13)
#define IN_ALT1                         (1<<14)
#define IN_SCORE                        (1<<15)     // Used by client.dll for when scoreboard is held down
__________________

Last edited by Bugsy; 07-31-2010 at 12:06.
Bugsy is offline
Vechta
Veteran Member
Join Date: Jun 2010
Old 07-31-2010 , 12:12   Re: different
Reply With Quote #3

So this is right?
Code:
		if ((button & IN_USE) && (oldbutton && IN_USE))
			function1(id)
		
		if ((!button & IN_USE) && (oldbutton & IN_USE))
			function2(id)
Vechta is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-31-2010 , 13:10   Re: different
Reply With Quote #4

Use button is being held (make sure you replace the && with & in the oldbutton condition.
if ((button & IN_USE) && (oldbutton && IN_USE))

Use button released
if ((!button & IN_USE) && (oldbutton & IN_USE))
__________________
Bugsy 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 00:06.


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