Say "damage" is the name of the 4th argument in your Ham_TakeDamage function, when you call SetHamParamFloat(4, somerandomvalue), the "damage" argument remains the same, it's only changed for the next calls of the function. So what you are doing is this.
Original "damage" is 25.
You deal damage with farpiece, so you SetHamParamFloat(4, 500), expecting the damage to become 500.
You are higher than level 1, so you are using SetHamParamFloat(4, damage*leveldamage) to further boost your intended damage, however "damage" is still at 25, not 500, so farpiece damage is ignored.
A fix for this is to assign the "damage" variable to the same value you intend it to be after using SetHamParamFloat, so instead of typing
PHP Code:
SetHamParamFloat(4, get_pcvar_float(farpiece_damagehs))
You type
PHP Code:
SetHamParamFloat(4, get_pcvar_float(farpiece_damagehs))
damage = get_pcvar_float(farpiece_damagehs)
However you are calling get_pcvar_float twice for no reason now, so you can do something like what I wrote below.
PHP Code:
if(farpiece[attacker])
{
if(get_user_weapon(attacker) == CSW_AK47 && damagetype & DMG_BULLET)
{
if(get_pdata_int(victim, 75) == HIT_HEAD)
{
damage = get_pcvar_float(farpiece_damagehs)
}
else
{
damage = get_pcvar_float(farpiece_damage)
}
}
if(level[id] >= 1)
{
SetHamParamFloat(4, damage*leveldamage)
}
else
{
SetHamParamFloat(4, damage)
}
}
else if(level[id] >= 1)
{
SetHamParamFloat(4, damage*leveldamage)
}