Witam, czy ktoś wie dlaczego nie mogę skompilować tego sma?
Bardzo bym prosił o pomoc.
Kompilacja lokalna też nie podziałała, chyba że komuś się uda to poprosiłbym o wstawkę amxx
Ten plugin wykorzystać chcę na swoim serwerze gdzie czasem w ZPA jest bug i nie ma w rundzie pierwszego Zombie.
Źródło kodu: allied modders (mam nadzieje że nie uznacie tego jako reklamę)
Dziękuję czekam na pomoc z waszej strony.
#include <amxmodx> #include <chatcolor> #include <zombieplague> // Native from hamsandwich.inc // --------------------------- native HamHook:RegisterHam(Ham:function, const EntityClass[], const Callback[], Post=0); enum Ham { Ham_Spawn = 0 } // Native from fakemeta.inc // ------------------------ native set_pev(_index,_value,any:...); new g_extra_antidote, cvar_toggle, cvar_delay, cvar_hits, cvar_antidote, cvar_effects new g_timer[33], g_hits[33] #define TASK_INFECT 5757 #define ID_INFECT (taskid - TASK_INFECT) public plugin_init() { register_plugin("[ZPNM] Delayed Infection", "1.1", "9 3 () |2 9 ! /<") RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1) cvar_toggle = register_cvar("zpnm_delayed_infection", "1") cvar_delay = register_cvar("zpnm_delayed_infection_time", "15") cvar_hits = register_cvar("zpnm_delayed_infection_hits", "3") cvar_antidote = register_cvar("zpnm_delayed_infection_antidote", "1") cvar_effects = register_cvar("zpnm_delayed_infection_effects", "1") } public plugin_precache() g_extra_antidote = zp_register_extra_item("Contamination Antidote", 11, ZP_TEAM_HUMAN) public fw_PlayerSpawn_Post(id) { g_hits[id] = 0 if (task_exists(id+TASK_INFECT)) { remove_task(id+TASK_INFECT) fm_set_rendering(id) } } public zp_user_infect_attempt(id, infector) { if (!get_pcvar_num(cvar_toggle) || !infector) return PLUGIN_CONTINUE; g_hits[id]++ if (g_hits[id] >= get_pcvar_num(cvar_hits)) return PLUGIN_CONTINUE; if (!task_exists(id+TASK_INFECT)) { g_timer[id] = get_pcvar_num(cvar_delay) set_task(1.0, "zpnm_infect_user", id+TASK_INFECT, _, _, "b") if (get_pcvar_num(cvar_effects)) fm_set_rendering(id, kRenderFxGlowShell, get_cvar_num("zp_nvg_color_R"), get_cvar_num("zp_nvg_color_G"), get_cvar_num("zp_nvg_color_B"), kRenderNormal, 0) static reward reward = get_cvar_num("zp_zombie_infect_reward") zp_set_user_ammo_packs(infector, zp_get_user_ammo_packs(infector) + reward) client_print_color(infector, Blue, "^4[ZPNM]^3 You received %d ammo pack%s for contamining a human.", reward, reward > 1 ? "s" : "") } return ZP_PLUGIN_HANDLED; } public zp_user_infected_post(id, infector) { if (!infector || !task_exists(id+TASK_INFECT)) return; remove_task(id+TASK_INFECT) g_hits[id] = 0 } public zp_extra_item_selected(id, itemid) { if (itemid != g_extra_antidote) return PLUGIN_CONTINUE; if (!get_pcvar_num(cvar_toggle) && !task_exists(id+TASK_INFECT)) { client_print_color(id, Red, "^4[ZPNM]^3 Delayed infection is off. You can't use this.") return ZP_PLUGIN_HANDLED; } if (!get_pcvar_num(cvar_antidote)) { client_print_color(id, Red, "^4[ZPNM]^3 Contamination antidote is unaccesable.") return ZP_PLUGIN_HANDLED; } if (!task_exists(id+TASK_INFECT)) { client_print_color(id, Grey, "^4[ZPNM]^3 You are not contamined with the virus!") return ZP_PLUGIN_HANDLED; } remove_task(id+TASK_INFECT) g_hits[id] = 0 fm_set_rendering(id) client_print_color(id, Blue, "^4[ZPNM]^3 Antidote taken and contamination neutralized!") return PLUGIN_CONTINUE; } public zpnm_infect_user(taskid) { if (g_timer[ID_INFECT] > 0) { if (get_pcvar_num(cvar_antidote)) client_print(ID_INFECT, print_center, "You are contamined! You have %d second%s to take an antidote before you get infected!", g_timer[ID_INFECT], g_timer[ID_INFECT] > 1 ? "s" : "") else client_print(ID_INFECT, print_center, "You are contamined! You have %d second%s before you get infected!", g_timer[ID_INFECT], g_timer[ID_INFECT] > 1 ? "s" : "") g_timer[ID_INFECT]-- } else { zp_infect_user(ID_INFECT) remove_task(taskid) } } // Set entity's rendering type (from fakemeta_util) stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 0) { static Float:color[3] color[0] = float(r) color[1] = float(g) color[2] = float(b) set_pev(entity, 78, fx) set_pev(entity, 134, color) set_pev(entity, 77, render) set_pev(entity, 40, float(amount)) }
Użytkownik erka edytował ten post 19.12.2013 22:02