Raised This Month: $ Target: $400
 0% 

button command combination detection


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 12-29-2008 , 15:56   button command combination detection
Reply With Quote #1

Most of us know that some buttons are pev_buttons & BUTTON ... But how we can detect if client used for example:

"-duck;+jump" in one frame. I mean, how can we detect what was typed first?
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.
MPNumB is offline
Send a message via Skype™ to MPNumB
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 12-29-2008 , 16:02   Re: button command combination detection
Reply With Quote #2

You can't know which one was typed first. But it's very unlikely someone can press buttons that fast, considering most people have around 100fps, the player would have to change buttons in 10ms. Try doing some testing, loggin buttons and check if you really can do it in a single frame.
__________________

Community / No support through PM
danielkza is offline
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 12-29-2008 , 16:57   Re: button command combination detection
Reply With Quote #3

alias do_the_cmd "-duck;+jump"

bind X do_the_cmd
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.
MPNumB is offline
Send a message via Skype™ to MPNumB
Old 12-29-2008, 17:17
Dores
This message has been deleted by Dores. Reason: LoL
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 12-29-2008 , 17:19   Re: button command combination detection
Reply With Quote #4

Maybe, after the player used the "do_the_cmd" alias, IN_DUCK(-duck) is now in pev_oldbuttons and IN_JUMP(+jump) is in pev_buttons?
If so, you will have to check the time that has passed between both buttons. If it's below 1.0, he used both at the same time.
__________________
O o
/¯________________________
| IMMA FIRIN' MAH LAZOR!!!
\_¯¯¯
Dores is offline
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 12-29-2008 , 17:38   Re: button command combination detection
Reply With Quote #5

Command is passed in one frame in one and the same time. That's how well known kreedz jumping technique called jumpbug works. There is no delay - everything happens in one player think event.
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.
MPNumB is offline
Send a message via Skype™ to MPNumB
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 12-29-2008 , 18:01   Re: button command combination detection
Reply With Quote #6

Quote:
Originally Posted by MPNumB View Post
Command is passed in one frame in one and the same time. That's how well known kreedz jumping technique called jumpbug works. There is no delay - everything happens in one player think event.
You can check the oldbuttons and compare with the current ones. If oldbuttons contains duck and not jump, and new buttons contain jump but not duck, you've got -duck; +jump at a single frame.
__________________

Community / No support through PM
danielkza is offline
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 12-29-2008 , 18:03   Re: button command combination detection
Reply With Quote #7

I need to check was it "-duck;+jump" or "+jump;-duck". WHAT WAS THE COMBINATIONS?

P.S. In Ham_Player_Jump pev_flags in both cases contain FL_DUCKING .
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.
MPNumB is offline
Send a message via Skype™ to MPNumB
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 12-29-2008 , 18:10   Re: button command combination detection
Reply With Quote #8

Quote:
Originally Posted by MPNumB View Post
I need to check was it "-duck;+jump" or "+jump;-duck". WHAT WAS THE COMBINATIONS?

P.S. In Ham_Player_Jump pev_flags in both cases contain FL_DUCKING .
Try checking the order of Ham_Player_Jump and Ham_Player_Duck, that's the only possible solution I can think of.
__________________

Community / No support through PM
danielkza is offline
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 12-29-2008 , 18:34   Re: button command combination detection
Reply With Quote #9

When -duck will be called in that frame we wont have ham_player_duck anyway. When +jump will be called in that frame ham_player_jump will be called, so we wont have any combination...

But somehow engine detects that! You can even test that like this:

"+duck;wait;-duck;+jump;wait;-jump" - will end in result that player will double duck.

"+duck;wait;+jump;-duck;wait;-jump" - will end in result that player will jump.
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.
MPNumB is offline
Send a message via Skype™ to MPNumB
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 09:10.


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