Yeah that's what I'm using and I couldn't seem to figure it out. Here is the code...
PHP Code:
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_forward(FM_UpdateClientData, "UpdateClientData_Post", 1);
}
public client_PreThink(id)
{
if(!is_user_alive(id))
{
return PLUGIN_CONTINUE;
}
// Remove the attack button from their button mask
entity_set_int(id, EV_INT_button, entity_get_int(id, EV_INT_button) & ~IN_ATTACK);
if(pev(id, pev_button) & IN_ATTACK)
{
// Added this to check if it would spam test when I held attack down
client_print(0, print_chat, "test");
}
return PLUGIN_CONTINUE;
}
public UpdateClientData_Post(id, sendweapons, cd_handle)
{
if(!is_user_alive(id))
{
return FMRES_IGNORED;
}
set_cd(cd_handle, CD_ID, 0);
return FMRES_HANDLED;
}