#include <amxmodx> #include <codmod> #include <hamsandwich> #define DMG_BULLET (1<<1) new bool:ma_klase[33]; new const nazwa[] = "Elitarny Komendant"; new const opis[] = "1/15 Deagl, Szybszy"; new const bronie = (1<<CSW_MAC10)|(1<<CSW_DEAGLE); new const zdrowie = 40; new const kondycja = 60; new const inteligencja = 0; new const wytrzymalosc = 30; public plugin_init(){ register_plugin(nazwa, "1.0", "ktos"); cod_register_advance(cod_get_classid("Komendant"), 120, nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc); RegisterHam(Ham_TakeDamage, "player", "TakeDamage"); } public cod_class_enabled(id) ma_klase[id] = true; public cod_class_disabled(id) 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)) return HAM_IGNORED; if(get_user_weapon(idattacker) == CSW_DEAGLE && 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; }
Jest to awans klasy, zwykła klasę udało mi się skompilować lecz awansu niezbyt ; /
Jeśli można to poprosze też o link do kompilatora który czyta: #include <codmod>
Przepraszam za edit lecz dałem zły plik *.sma, tamten należał do zwykłej klasy ; >