It won't take into account the delay between attacks, you you'll have to simulate that if you want continuous fire. Without that small delay I'm not getting any sounds, don't know why.
That's as far as I'm willing to go without the XY-problem being cleared.
Code:
#include <amxmodx>
#include <hamsandwich>
#define m_pPlayer 41 // CBasePlayerItem, Linux +4
new gWeaponEntIndex[33];
public plugin_init() {
register_plugin("Test Plugin 1", "", "[ --{-@ ]");
register_clcmd("say /attack", "clcmdAttack");
RegisterHam(Ham_Item_Deploy, "weapon_m4a1", "fwdItemDeploy");
}
public fwdItemDeploy(index)
gWeaponEntIndex[get_pdata_cbase(index, m_pPlayer, 4)] = index;
public clcmdAttack(id)
set_task(0.1, "delayAttack", id);
public delayAttack(id)
ExecuteHam(Ham_Weapon_PrimaryAttack, gWeaponEntIndex[id]);
__________________