/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <codmod>
#include <hamsandwich>
#include <fakemeta>


new const perk_name[] = "Nano Kamizelka";
new const perk_desc[] = "Jestes odporny na wszystkie umiejetnosci oraz perki. Trudna do zdobycia.";


new bool:ma_perk[33];

public plugin_init() 
{
	register_plugin(perk_name, "1.0", "QTM_Peyote");
	
	cod_register_perk(perk_name, perk_desc, 1, 2);
	
	RegisterHam(Ham_TakeDamage, "player", "TakeDamage")
}

public cod_perk_enabled(id, wartosc)
{
	if(wartosc == 1)
		return COD_STOP;
	
	ma_perk[id] = true;
	return COD_CONTINUE;
}
	
public cod_perk_disabled(id)
	ma_perk[id] = false;

public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
	if(!is_user_connected(idattacker))
		return HAM_IGNORED;
	
	if(!ma_perk[this])
		return HAM_IGNORED;
	
	if(damagebits & DMG_CODSKILL)
		return HAM_SUPERCEDE;
		
	return HAM_IGNORED;
}
