Raised This Month: $51 Target: $400
 12% 

Detecting JUMP+DUCK to boost yourself


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
marcelowzd
Senior Member
Join Date: Feb 2011
Location: São Paulo, Brazil
Old 11-13-2018 , 15:21   Detecting JUMP+DUCK to boost yourself
Reply With Quote #1

Hi guys,

I'm trying to detect, in bhop, when a player uses the JUMP + DUCK trick to give himself a "boost"

If you don't know how to reproduce this, just hold jump and duck while you bhop and when you're in the ground release the duck button, you'll go a bit higher (at least it looks like it)

PHP Code:
#include < amxmodx >
#include < fakemeta >

public plugin_init( )
{
    
register_forwardFM_PlayerPreThink"OnClientPreThink" );
}

public 
OnClientPreThinkiClient )
{
    if( !
is_user_aliveiClient ) )
        return 
FMRES_IGNORED;

    static 
biButtonsbiOldButtonsbiFlagsbiOldFlags;

    
biButtons peviClientpev_button );
    
biOldButtons peviClientpev_oldbuttons );
    
biFlags peviClientpev_flags );

    if( 
biButtons IN_JUMP && !( biButtons IN_DUCK ) && biOldButtons IN_DUCK && biOldFlags FL_ONGROUND )
    { 
        
client_printiClientprint_chat"Debug test" );
    }

    
biOldFlags biFlags;

    return 
FMRES_IGNORED;

I wrote this and it works (kinda) but there are some cases that it doesn't detect, because you can be above the ground already and still do this boost, so i need some tip in how to do this.

Thanks in advance.
__________________
marcelowzd is offline
 



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


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