/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fakemeta>
#include <codmod>
#include <hamsandwich>
 
#define DMG_BULLET (1<<1)


new const perk_name[] = "Eagle Eye";
new const perk_desc[] = "Widzisz Niewidzialnych zadajesz 20 wiecej obrazen";

new bool:ma_perk[33];

public plugin_init()
 {
	register_plugin(perk_name, "1.0", "Play");
	
	cod_register_perk(perk_name, perk_desc);
	register_forward(FM_AddToFullPack, "FwdAddToFullPack", 1)	
	RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
}

public cod_perk_enabled(id)
	ma_perk[id] = true;

public cod_perk_disabled(id)
	ma_perk[id] = false;

public FwdAddToFullPack(es_handle, e, ent, host, hostflags, player, pSet)
{
	if(!is_user_connected(host) || !is_user_connected(ent))
		return;
		
	if(!ma_perk[host])
		return;
		
	set_es(es_handle, ES_RenderAmt, 255.0);
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
	if(!is_user_connected(idattacker))
		return HAM_IGNORED;
		
	if(ma_perk[idattacker])
		cod_inflict_damage(idattacker, this, 20.0, 0.0, idinflictor, damagebits);
		
	return HAM_IGNORED;
}