#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <fun>
#include <hamsandwich>
#define DMG_BULLET (1<<1)
new const nazwa[] = "SWAT";
new const opis[] = "1/15 na natychmiastowe zabicie z five-sven + zwiększone dmg 5int=1dmg";
new const bronie = (1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FIVESEVEN)|(1<<CSW_FLASHBANG);
new const zdrowie = 40;
new const kondycja = 0;
new const inteligencja = 25;
new const wytrzymalosc = 25;
new ma_klase[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");
}
public cod_class_enabled(id)
{
ma_klase[id] = true;
cod_set_user_shield(id, 1);
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_smokegrenade");
}
public cod_class_disabled(id)
{
ma_klase[id] = false;
cod_set_user_shield(id, 0);
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_klase[idattacker])
return HAM_IGNORED;
if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_FIVESEVEN && damagebits & DMG_BULLET && random_num(1, 15) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
return HAM_IGNORED;
}