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_forward( FM_PlayerPreThink, "OnClientPreThink" );
}
public OnClientPreThink( iClient )
{
if( !is_user_alive( iClient ) )
return FMRES_IGNORED;
static biButtons, biOldButtons, biFlags, biOldFlags;
biButtons = pev( iClient, pev_button );
biOldButtons = pev( iClient, pev_oldbuttons );
biFlags = pev( iClient, pev_flags );
if( biButtons & IN_JUMP && !( biButtons & IN_DUCK ) && biOldButtons & IN_DUCK && biOldFlags & FL_ONGROUND )
{
client_print( iClient, print_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.
__________________