Hi everybody, well im trying to block IN_JUMP button when a player hold right, left and forward button at the same time, but i want to activate the button IN_JUMP again when the player stop hold this buttons i mean left, right and forward button, i found a code of connor but i dunno how i can make to block jump button when the player hold the buttons that i mentioned, then when this stop hold button i want to enable the IN_JUMP button again, how i can make this? can someone help me.. thx in advance
another thing can u tell me if the code is fine?
code:
PHP Code:
#include <amxmodx>
#include <fakemeta>
#define m_afButtonLast 245
public plugin_init()
{
register_forward(FM_CmdStart, "OnCmdStart", false)
}
public OnCmdStart(id, cmd)
{
static buttons, buttonsChanged, buttonPressed, buttonReleased
buttons = get_uc(cmd, UC_Buttons)
buttonsChanged = get_pdata_int(id, m_afButtonLast) ^ buttons
buttonPressed = buttonsChanged & buttons
buttonReleased = buttonsChanged & ~buttons
if(buttonPressed & IN_FORWARD && buttonPressed & IN_MOVERIGHT && buttonPressed & IN_MOVELEFT)
{
set_pev( id, pev_oldbuttons, pev( id, pev_oldbuttons ) | IN_JUMP )
}
else if(buttonReleased & IN_FORWARD && buttonReleased & IN_MOVERIGHT && buttonReleased & IN_MOVELEFT)
{
set_pev( id, pev_oldbuttons, pev( id, pev_oldbuttons ) & ~IN_JUMP )
}
}