You can only do this with the
Ham Sandwich Module.
Here's an example:
Code:
#include <amxmodx>
#include <hamsandwich>
#define PLUGIN "Damage Half"
#define VERSION "1.0"
#define AUTHOR "stupok69"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_TakeDamage, "player", "player_hurt")
}
public player_hurt(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(is_user_alive(idattacker))
{
damage *= 0.5 //half damage
ExecuteHam(Ham_TakeDamage, this, idinflictor, idattacker, damage, damagebits)
return HAM_SUPERCEDE
}
return HAM_IGNORED
}