Just add a check before
GetEntityClassname (line 437)
Like this:
Code:
new iWeaponEnt = GetEntPropEnt(attacker, Prop_Send, "m_hActiveWeapon");
if (iWeaponEnt != -1 && IsValidEntity(iWeaponEnt)) {
GetEntityClassname(iWeaponEnt, szClassName, sizeof(szClassName));
if (StrEqual(szClassName, "tf_weapon_knife") && (damagetype & DMG_CRIT == DMG_CRIT))
{
//Backstab detected.
if (IsPlayerInTank[victim]){
damage = 200.0;
action = Plugin_Changed;
}
}
if (IsPlayerInTank[attacker] && (damagetype & DMG_CRIT == DMG_CRIT)){
if (Supercrits[attacker]){
damage = damage * 2.5;
action = Plugin_Changed;
}
}
if (IsPlayerInTank[victim] && !IsPlayerInTank[attacker]){
if (Supercrits[victim] && !(damagetype & TF_DMG_MELEE == TF_DMG_MELEE)){
damage = damage * 0.55;
action = Plugin_Changed;
}
if (FiresHeavyLasers[victim] && GetClientHealth(victim) >= 2000){
damage = damage * 0.75;
action = Plugin_Changed;
}
if (InvisiTank[victim] && damage >= 200.0){
if (TF2_IsPlayerInCondition(victim, TFCond:110)){
TF2_RemoveCondition(victim, TFCond:110);
}
}
}
}
return action;
__________________