#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <hamsandwich>
#define DMG_BULLET (1<<1)
new const nazwa[] = "Kapitan";
new const opis[] = "Odbija 2 pociski w rundzie";
new const bronie = (1<<CSW_SG552);
new const zdrowie = 20;
new const kondycja = 0;
new const inteligencja = 0;
new const wytrzymalosc = 0;
new bool:ma_klase[33];
new pozostale_strzaly[33];
public plugin_init()
{
register_plugin(nazwa, "1.0", "amxx.pl");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
RegisterHam(Ham_Spawn, "player", "Spawn", 1);
}
public cod_class_enabled(id)
{
ma_klase[id] = true;
pozostale_strzaly[id] = 2;
}
public cod_class_disabled(id)
ma_klase[id] = false;
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!ma_klase[this])
return HAM_IGNORED;
if(pozostale_strzaly[this] > 0 && damagebits & DMG_BULLET)
{
pozostale_strzaly[this]--;
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}
public Spawn(id)
pozostale_strzaly[id] = 2;