Raised This Month: $ Target: $400
 0% 

Getting old buttons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 09-18-2004 , 12:23   Getting old buttons
Reply With Quote #1

Ok, could someone explain what get_user_oldbutton can do?
Can it get the buttons the person pressed BEFORE pressing the button they just did? I'm not getting it. Help me please!
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 09-18-2004 , 12:30  
Reply With Quote #2

Its the buttons of the last frame (although i prefer to get them on my own in server_frame because I have a bad experience with this).
When you have the current and the last buttons, you can easily get what buttons were pressed / released between this frame and the frame before.

Code:
            g_PlayerKeysPressed[i] = (g_PlayerKeys[i] ^ g_PlayerOldKeys[i]) & g_PlayerKeys[i];      // (new xor old) and new             g_PlayerKeysReleased[i] = (g_PlayerKeys[i] ^ g_PlayerOldKeys[i]) & g_PlayerOldKeys[i]// (new xor old) and old

That is how i do it in my superkeeper plugin.
__________________
hello, i am pm
PM is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 09-18-2004 , 14:25  
Reply With Quote #3

Thank you!
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Reply


Thread Tools
Display Modes

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 17:12.


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