You can use a cooldown timer.
Create two global variables: one that tracks time and another that tracks hits. Next, in the function where damage is done, check if the current time minus the time stored in the variable is less than the allowed time. If it is, raise the tracked hits. Next, check if the tracked hits is higher than your allowed value and if it's not do whatever action you think is appropriate. Here's a skeletal version of what I just said:
Code:
#define MIN_TIME 5
#define MAX_HITS 3
new g_Time[33]
new g_Hits[33]
public TeammateDamage(Attacker)
{
new CurTime = get_gametime()
g_Hits[Attacker] = (CurTime - g_Time[Attacker] < MIN_TIME) ? g_Hits[Attacker] + 1 : 1
if(g_Hits[Attacker] > MAX_HITS)
{
/* Perform your action */
}
g_Time[Attacker] = CurTime
}
I left out a lot of stuff, such as the hook for damage, but by the way you asked it sounds like you already know how to do everything else.
__________________