Fight[Premium]
oto sma:
#include <amxmodx> #include <amxmisc> #include <codmod> #include <engine> #include <hamsandwich> #include <fun> #define DMG_BULLET (1<<1) #define DMG_HEGRENADE (1<<24) new const nazwa[] = "Fight [Mega Premum](23,37zl)]"; new const opis[] = "Ma XM1014(shotgun)1/5 na natych zabicie, Scout1/2, HE1/2, 140hp, wysoki skok,"; new const bronie = (1<<CSW_SCOUT)|(1<<CSW_HEGRENADE)|(1<<CSW_XM1014)|(1<<CSW_USP); new const zdrowie = 40; new const kondycja = 00; new const inteligencja = 0; new const wytrzymalosc = 0; 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_Spawn, "player", "fwSpawn_Grawitacja", 1); RegisterHam(Ham_TakeDamage, "player", "TakeDamage"); } public cod_class_enabled(id) { if(!(get_user_flags(id) & ADMIN_LEVEL_F)) { client_print(id, print_chat, "[Fight [Mega Premum] (23,37zl)]] Nie masz uprawnien, aby uzywac tej klasy.") return COD_STOP; } entity_set_float(id, EV_FL_gravity, 400.0/800.0); give_item(id, "weapon_hegrenade"); ma_klase[id] = true; return COD_CONTINUE; } public cod_class_disabled(id) { entity_set_float(id, EV_FL_gravity, 1.0); ma_klase[id] = false; } public fwSpawn_Grawitacja(id) { if(ma_klase[id]) entity_set_float(id, EV_FL_gravity, 400.0/800.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_XM1014 && damagebits & DMG_BULLET && random_num(1, 6) == 1) if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_SCOUT && damagebits & DMG_BULLET && random_num(1, 2) == 1) if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_HEGRENADE && damagebits & DMG_HEGRENADE && random_num(1, 2) == 1) cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits); return HAM_IGNORED; }
Gdy już przekompiluje na amxx to wszystko jest ok:
Welcome to the AMX Mod X 1.8.1-300 Compiler. Copyright © 1997-2006 ITB CompuPhase, AMX Mod X Team Header size: 840 bytes Code size: 2812 bytes Data size: 1220 bytes Stack/heap size: 16384 bytes; estimated max. usage=783 cells (3132 bytes) Total requirements: 21256 bytes Done.
Ale jak wrzuce klase na serwer to nie dziala mi 1/x z broni na natychmiastowe zabicie, to samo z granatem ;//