PHP Code:
#pragma semicolon 1
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
public plugin_init()
{
register_plugin("Return Damage","0.1", "shadow.hk");
RegisterHam(Ham_TakeDamage,"player","fwdHamTakeDamage",1);
}
public fwdHamTakeDamage(iVictim, inflictor, iAttacker, Float:iDamage, bitDamage)
{
new iHealth = get_user_health(iAttacker);
if(!(1 <= iAttacker <= get_maxplayers()))
return HAM_IGNORED;
if(get_user_team(iVictim) == get_user_team(iAttacker))
{
if(iHealth - iDamage <= 0)
user_silentkill(iAttacker);
if(is_user_alive(iAttacker))
set_pev(iAttacker,pev_health,iHealth - iDamage);
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}
Depending on what you want it for specifically... that script is for team attackers. Just change get_user_team to what you want, or any other conditional.