I think this should work
Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
new g_attack[33];
new holding_attack[33];
public plugin_init()
{
register_forward(FM_PlayerPreThink, "fm_playerthink", 1);
set_task(2.0, "display_attack_num", 110477, "", 0, "b");
}
public fm_playerthink(id)
{
if((pev(id, pev_button) & IN_ATTACK) && !(pev(id, pev_oldbuttons) & IN_ATTACK))
{
holding_attack[id] = true;
g_attack[id]++;
}
if((pev(id, pev_oldbuttons) & IN_ATTACK) && !(pev(id, pev_button) & IN_ATTACK))
{
holding_attack[id] = false;
}
}
public display_attack_num()
{
new playercount, Players[32]
get_players(Players, playercount,"a")
for (new i=0; i < playercount; ++i)
{
client_print(Players[i], print_chat, "attacks: %d - in-attack: %s", g_attack[Players[i]], holding_attack[Players[i]] ? "true" : "false");
}
}
__________________