I feel like I must be.
But I have looked at this code very hard. And it's not even that late at night...it's just odd.
I'm blocking weapon fire server sided, both attack and attack2. Just like I normally do. But for some reason, if you fire or attack2 while you are not on the ground (ie. falling or walking off a step) it does not get blocked.
Code:
public fwd_CmdStart( id, uc_handle, seed ) {
if( plugin_enabled() && is_user_alive(id) && has_flamethrower(id, get_user_weapon(id)) )
{
static buttons;
buttons = get_uc( uc_handle, UC_Buttons );
if( buttons & IN_ATTACK )
{
buttons &= ~IN_ATTACK;
set_animation( id, sequences:altfirecycle );
client_print( id, print_center, "Firing" );
}
if( buttons & IN_ATTACK2 )
{
buttons &= ~IN_ATTACK2;
client_print( id, print_center, "Attack2 Blocked" );
}
set_uc( uc_handle, UC_Buttons, buttons );
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
The Client_Print always gets sent - even when you are falling (and the block doesn't work).
The block always works when you are on the ground.
I have tried the equivelant of this with FM_PlayerPreThink and the same thing happens.
I can't imagine why it hasn't been noticed before...am I doing something wrong here?
Code:
register_forward( FM_CmdStart, "fwd_CmdStart" ); // Tried post too - same thing
__________________