I dont under stand how it's expensive to use OnPlayerRunCmd?
something like this to make a toggle command:
Code:
public Action:OnPlayerRunCmd(iClient, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
{
if (!IsClientConnected(iClient) || !IsClientInGame(iClient) || !IsPlayerAlive(iClient)) return Plugin_Continue;
static bool:bIsInAttack[MAXPLAYERS+1];
if (!bIsInAttack[iClient] && buttons & IN_ATTACK)
{
bIsInAttack[iClient] = true;
SomeOtherFunction(iClient);
}
else
{
bIsInAttack[iClient] = false;
}
return Plugin_Continue;
}
bit tired so it might be wrong