#include <amxmodx>
#include <fakemeta_stocks>
#include <hamsandwich>

#pragma tabsize 4
#pragma ctrlchar '\'

#define MY_PLUGIN_NAME    "HE SelfDamage Free"
#define MY_PLUGIN_VERSION "1.0.0"
#define MY_PLUGIN_AUTHOR  "Simon Logic"

#define DMG_HEGRENADE (1<<24)

public plugin_init()
{
	register_plugin(MY_PLUGIN_NAME, MY_PLUGIN_VERSION, MY_PLUGIN_AUTHOR)

	RegisterHam(Ham_TakeDamage, "player", "onPlayerDamage")
	//RegisterHam(Ham_TakeDamage, "player", "onPlayerDamage_Post", 1)
}

public onPlayerDamage(victim, inflictor, attacker, Float:dmg, dmg_type)
{
	if(dmg_type & DMG_HEGRENADE && victim == attacker)
		return HAM_SUPERCEDE
	return HAM_IGNORED
}
