Code:
public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype)
{
if(GetEntityClassname(victim, "witch", 10) && attacker > 0 && GetClientTeam(attacker) == 2 && g_iLevel[attacker] > 0 && attacker <= MaxClients && victim > MaxClients)
{
damage = GetRandomFloat(criMulMin, criMulMAX) * damage + 1;
Knockback(attacker, victim, CritForce, 1.5, 2.0);
if (CritPrint)
{
PrintToChat(attacker, "\x01Critical!\x03 %.2f\x01 damage", damage);
}
return Plugin_Changed;
}
if (attacker > 0 && attacker <= MaxClients && GetClientTeam(attacker) == 2 && g_iLevel[attacker] > 0)
{
if (GetClientTeam(victim) == 2)
{
return Plugin_Continue;
}
damage = GetRandomFloat(criMulMin, criMulMAX) * damage + 1;
if (CritPrint)
{
PrintToChat(attacker, "\x01Critical!\x03 %.2f\x01 damage", damage);
}
Knockback(attacker, victim, CritForce, 1.5, 2.0);
return Plugin_Changed;
}
return Plugin_Continue;
}
GetEntityClassname(victim, "witch", 10) also works for any special infected, I don't know why.
I need another if statement on top to make the plugin work, I also don't know why.