#include < amxmodx >
#include < hamsandwich >
#include < zombieplague >
#include < fun >

#define MAX_CLIENTS             32

#define VAMPIRIC_HP                     10
#define VAMPIRIC_DAMAGE               300.0

new Float:g_Damage[MAX_CLIENTS +1];

new g_MaxPlayers;

public plugin_init()
{
        RegisterHam(Ham_TakeDamage, "player", "Damage" , 1);
        
        g_MaxPlayers = get_maxplayers();
}

public Damage(Victim, Inflictor, Attacker, Float:flDamage, iDmgBits)
{
        if(!(1<= Attacker <= g_MaxPlayers))
                return HAM_IGNORED;    

        if(!is_user_alive( Attacker)||!zp_get_user_survivor(Attacker))
                return HAM_IGNORED;

        if(zp_get_user_zombie( Victim))
                return HAM_IGNORED;
		
        g_Damage[Attacker] += flDamage;

        if(g_Damage[Attacker] >= VAMPIRIC_DAMAGE)
        {
                g_Damage[Attacker] -= VAMPIRIC_DAMAGE;
                set_user_health(Attacker, get_user_health(Attacker) + VAMPIRIC_HP);
        }
        return HAM_IGNORED;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1251\\ deff0\\ deflang1049{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/
