Yeah, I don't think that it'd be feasibly possible with Sourcemod alone.
All animation states are client-sided.
Thus, any crit edits you do after the fact of attack won't play.
Now you could allow crits, then use the calculated crit rate and return plugin_continue for only knife and false with plugin_handled for any other weapon.
There's a drawback, though.
All client-sided predicted crits will show up as crits on their screen.
When the server sees none of that.
For instance, a heavy with predicted crits will see the crit bullets, while not getting crit hits.
I'd fear that would actually be worse than not having a backstab animation.
If anything, you should definitely file a bug report to Valve.
The code to do the knife thing with drawbacks:
Code:
public Action:TF2_CalcIsAttackCritical(client, weapon, String:weaponname[], &bool:result)
{
if(StrEqual(weaponname, "tf_weapon_knife"))
{
return Plugin_Continue; //Normal crits for knife only
}
result = false; //0% crits for all other weapons
return Plugin_Handled; //Stop TF2 from doing anything about it
}
Okay, this is going on a HUGE stretch!
Looking back at the events, you *might* be able to hook an event with a Prethink hook to edit the event then send it to the client.
"player_hurt" event has the 'weaponid' entity index, and 'crit' to determine if it were a crit.
You can get the type of weapon from the index with:
Code:
decl String:WeaponTitle[128]; //Never know what Valve will name future weapons, best keep it big.
GetEdictClassname(WeaponEntityIndexNumber, WeaponTitle, sizeof(WeaponTitle));
And force the event's 'crit' field to be a 1 if the TF2_CalcIsAttackCritical returns true on the knife.
Then force all other weapons 'crit' field to be a 0 regardless of the Calculated crit.