I'm trying to create a script that will increase the decaps and focus meter of the Bazaar Bargain and the Hitman's Heatmaker, however I only want this to trigger upon a headshot. Now I've got the first part of that figured out, however when I try to detect a headshot using TF_CUSTOM_HEADSHOT and TF_CUSTOM_HEADSHOT_DECAPITATION it also counts scoped bodyshots. I've tried this with both OnTakeDamage and the player_hurt event, both yield the same results. I'd really appreciate some advice.
PHP Code:
switch (weaponid)
{
case (77):
if(HasEntProp(attacker, Prop_Send, "m_iDecapitations") && TF_CUSTOM_HEADSHOT)
{
SetEntProp(attacker, Prop_Send, "m_iDecapitations", GetEntProp(attacker, Prop_Send, "m_iDecapitations") + 1);
}
case (17):
if (HasEntProp(attacker, Prop_Send, "m_flRageMeter") && TF_CUSTOM_HEADSHOT && GetEntPropFloat(attacker, Prop_Send, "m_flRageMeter") < 100.0)
{
SetEntPropFloat(attacker, Prop_Send, "m_flRageMeter", GetEntPropFloat(attacker, Prop_Send, "m_flRageMeter") + 20.0);
}
}
In the code above I'm using the event player_hurt.