Quote:
Originally Posted by Bugsy
I'm not sure what conditions you are checking, I just took a guess here.
PHP Code:
//If attacker is dead or attacker hurt himself, return. if( !is_user_alive( idattacker ) || ( this == idattacker ) ) return HAM_IGNORED;
|
I think there should be:
PHP Code:
//If attacker is dead or attacker hurt himself, return.
if( !is_user_alive( idattacker ) && ( this == idattacker ) )
return HAM_IGNORED;
I just want to increase or decrease taken damage from knife, weapon or fall.
This is the whole code:
PHP Code:
public fw_PlayerTakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_alive(idattacker) || this == idattacker)
return HAM_IGNORED;
if(get_user_weapon(idattacker) != CSW_KNIFE)
{
damage += // here we increase damage by shooting
}
else
{
damage += // here we increase damage by knife
}
damage -= // here we reduce damage from shooting
SetHamParamFloat(4, damage);
if(damagebits & DMG_FALL)
{
damage -= // here we reduce damage from falling
SetHamParamFloat(4, damage);
}
}
Could I detected using the damagebits parameter when damage is caused by a knife and when a weapon?