Komandor
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <hamsandwich> #include <codmod> new const perk_name[] = "Złote Naboje"; new const perk_desc[] = "Zadajesz 20(+int) obrazen wiecej"; 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(!is_user_connected(idattacker)) return HAM_IGNORED; if(ma_perk[idattacker]) cod_inflict_damage(idattacker, this, 20.0, 0.25, idinflictor, damagebits); return HAM_IGNORED; }
A oto klasa z której chcialem to skopiować
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <codmod> #include <fun> #include <hamsandwich> #define DMG_BULLET (1<<1) new bool:ma_klase[33]; new const nazwa[] = "Speedhacker"; new const opis[] = "Natychmiastowe zabicie z noza(PPM), nie slychac jego krokow"; new const bronie = 1<<CSW_KNIFE; new const zdrowie = -10; new const kondycja = 100; new const inteligencja = 10; new const wytrzymalosc = 0; public plugin_init() { register_plugin(nazwa, "1.0", "QTM_Peyote"); 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) { set_user_footsteps(id, 1); ma_klase[id] = true; } public cod_class_disabled(id) { set_user_footsteps(id, 0); 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(get_user_weapon(idattacker) == CSW_KNIFE && damagebits & DMG_BULLET && damage > 20.0) cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits); return HAM_IGNORED; } public Spawn(id) { if(ma_klase[id]) { strip_user_weapons(id); give_item(id, "weapon_knife"); } }