PHP Code:
#include <amxmodx>
#include <hamsandwich>
const Float: fDmgPercent = 0.50;
public plugin_init()
{
RegisterHam(Ham_TakeDamage, "player", "FwdTakeDamage");
}
public FwdTakeDamage( iVictim , iInflictor , iAttacker , Float:fDamage , iDamagebits )
{
//fDamage passed to this forward is the amount of damage caused to victim
//Here you multiply the damage value by whatever multiplier you want.
//In this example, fDmgPercent is 0.50 meaning the damage amount will
//be reduced by half.
new Float: fResult = ( fDamage * fDmgPercent );
//This modifies the damage value passed to the game engine to make
//our calculated damage value take effect.
SetHamParamFloat( 4 , fResult );
return HAM_HANDLED;
}
__________________