Witam otoz jak pisze plugin z jedna bronia na 1/x jest ok wysztko ladnie ale jak pisze z dwoma broniami na 1/x niechce mi wejsc w komplitator: a o to moj kod.Chodzi mi o to czy ktos by mogl mi wytlumaczyc jak dodac 2bron na 1/x krok po kroku probowalem z roznych postow i niedalo rady
#include <amxmodx> #include <hamsandwich> #define DMG_BULLET (1<<1) #include <amxmisc> #include <codmod> #include <engine> #include <fakemeta> #include <fun> new const nazwa[] = "Obronca"; new const opis[] = "Famas[1/8] | M429[1/20] | AllGranaty"; new const bronie = (1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FIVESEVEN)|(1<<CSW_M249)|(1<<CSW_FLASHBANG)|(1<<CSW_FAMAS); new const zdrowie = 0; new const kondycja = 0; new const inteligencja = 0; new const wytrzymalosc = 0; new ma_klase[33]; public plugin_init() { register_plugin(nazwa, "1.0", "DEVILEK"); cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc); register_event("CurWeapon", "ModelBroni_CurWeapon", "be", "1=1"); register_forward(FM_SetModel, "ModelBroni_fw_SetModel"); } public plugin_precache() { precache_model(""); precache_model(""); precache_model(""); } public cod_class_enabled(id) { give_item(id, "weapon_hegrenade"); give_item(id, "weapon_flashbang"); give_item(id, "weapon_flashbang"); give_item(id, "weapon_smokegrenade"); ma_klase[id] = true; } public cod_class_disabled(id) { ma_klase[id] = false; } public ModelBroni_CurWeapon(id) { new weapon = read_data(2); if(ma_klase[id]) { if(weapon == CSW_M249) { set_pev(id, pev_viewmodel2, "") set_pev(id, pev_weaponmodel2, "") } } } public ModelBroni_fw_SetModel(entity, model[]) { if(!pev_valid(entity)) return FMRES_IGNORED if(!equali(model, "models/w_m249.mdl")) return FMRES_IGNORED; new entityowner = pev(entity, pev_owner); if(!ma_klase[entityowner]) return FMRES_IGNORED; engfunc(EngFunc_SetModel, entity, "") return FMRES_SUPERCEDE } 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_M249 && damage > 20.0 && random_num(1,20) == 1,20) cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits); if(weapon == CSW_FAMAS && damage > 20.0 && random_num(1,8) == 1,8) cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor } return HAM_IGNORED; }