Thread: return damage.
View Single Post
shadow.hk
Senior Member
Join Date: Dec 2008
Location: WA, Australia
Old 06-25-2009 , 10:20   Re: return damage.
Reply With Quote #3

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(iVictiminflictoriAttackerFloat:iDamagebitDamage)
{
 new 
iHealth get_user_health(iAttacker);
 
 if(!(
<= 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.
shadow.hk is offline
Send a message via MSN to shadow.hk