Spoiler
#include <amxmodx> #include <amxmisc> #include <codmod_frakcje> #include <engine> #include <hamsandwich> #define DMG_BULLET (1<<1) new const nazwa[] = "Snajper"; new const opis[] = "awp + obrazenia do niej z inteligencji, mniejsza widocznosc"; new const bronie = (1<<CSW_AWP)|(1<<CSW_DEAGLE); new const zdrowie = 20; new const kondycja = 25; new const inteligencja = 0; new const wytrzymalosc = 10; new const frakcja[] = "Amerykanie"; new bool:ma_klase[33]; public plugin_init() { register_plugin(nazwa, "1.0", "amxx.pl"); cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc, frakcja); RegisterHam(Ham_TakeDamage, "player", "TakeDamage"); } public cod_class_enabled(id) { set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 125); ma_klase[id] = true; } public cod_class_disabled(id) { set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255); ma_klase[id] = false; } public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits) { if(!is_user_connected(idattacker)) return HAM_IGNORED; if(!ma_klase[idattacker]) return HAM_IGNORED; if(damagebits & DMG_BULLET) { new weapon = get_user_weapon(idattacker); if(weapon == CSW_AWP) cod_inflict_damage(idattacker, this, 1.0, 1.0, idinflictor, damagebits); } return HAM_IGNORED; }