/* Plugin generated by AMXX-Studio */

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


new const perk_name[] = "Tarcza SWAT";
new const perk_desc[] = "Jestes odporny na miny, rakiety oraz dynamit";

new bool:ma_perk[33];

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

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

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

public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{	
	if(!ma_perk[this])
		return HAM_IGNORED;
		
	new classname[10]
	pev(idinflictor, pev_classname, classname, 9);
	
	if(equal(classname, "mine") || equal(classname, "rocket") || equal(classname, "dynamite"))
		return HAM_SUPERCEDE;

	return HAM_IGNORED;
}
