/* Plugin generated by AMXX Compiler Credits: --- Mercylezz, for his some useful codes... --- Mini_midget, for his idea and some codes :) --- GHW_Chronic, custom blood color for zombie --- crazyeffect, helped me about ML --- kmlkz, fix my mistake :) --- www.PartnersInRhyme.com , provide free SFX sounds (thunder sounds) --- All translators that help me completing MultiLang --- People that use this plugin --- All bug reporters */ #include #include #include #include #include #define PLUGIN "Half-Life : Zombie Mod" #define VERSION "001" #define AUTHOR "Anggara_nothing" // Uncomment this line for let this plug-in support Opposing Force //#define Opposing_Force new const ZOMBIE_CLAWS[] = "models/v_knife_zombie.mdl"; // Edit this line for custom claw model new const ZOMBIE_MODEL[] = "hlzmzombie"; // Edit this line for custom zombie model (short name only) new const HUMAN_MODEL[] = "hlzmhecu"; // Edit this line for custom human model (short name only) new const g_ambience_thunder[][] = // Thunder sounds { "ambience_thunder/thunder.wav", "ambience_thunder/thunder3.wav" } new const g_zombie_hitwall_sounds[][] = // Zombie "hitwall" sounds { "zombie/claw_strike1.wav", "zombie/claw_strike2.wav", "zombie/claw_strike3.wav" } new const g_zombie_pain_sounds[][] = // Zombie pain sounds { "zombie/zo_pain1.wav", "zombie/zo_pain2.wav" } new const g_zombie_die_sounds[][] = // Zombie dead sounds { "bullchicken/bc_die3.wav", "headcrab/hc_die2.wav", "bullchicken/bc_die1.wav", "aslave/slv_die2.wav" } new const g_zombie_idle_sounds[][] = // Zombie idle sounds { "zombie/zo_idle1.wav", "zombie/zo_idle2.wav", "zombie/zo_idle3.wav", "zombie/zo_idle4.wav", "headcrab/hc_idle3.wav", "nihilanth/nil_die.wav", "nihilanth/nil_now_die.wav", "nihilanth/nil_win.wav" } new const g_zombie_spawn_sounds[][] = // Zombie spawn sounds { "scientist/c1a0_sci_catscream.wav", "scientist/scream01.wav", "scientist/scream04.wav", "scientist/scream05.wav", "scientist/scream1.wav" } new const g_human_idle_sounds[][] = // Human idle sounds { "hgrunt/gr_idle1.wav", "hgrunt/gr_idle2.wav", "hgrunt/gr_idle3.wav", "hgrunt/gr_alert1.wav", "hgrunt/gr_loadtalk.wav" } new const g_human_pain_sounds[][] = // Human pain sounds { "hgrunt/gr_pain1.wav", "hgrunt/gr_pain2.wav", "hgrunt/gr_pain3.wav", "hgrunt/gr_pain4.wav", "hgrunt/gr_pain5.wav" } new const g_human_die_sounds[][] = // Human death sounds { "hgrunt/gr_die1.wav", "hgrunt/gr_die2.wav", "hgrunt/gr_die3.wav" } new const g_human_spawn_sounds[][] = // Human spawn sound { "barney/letsgo.wav", "scientist/letsgo.wav", "scientist/yesletsgo.wav" } //---------------------------------------------------------------------------------------- //-- Don't edit below this line... //---------------------------------------------------------------------------------------- new blooddecalwad[14] = {27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40} // Custom blood color by GHW_Chronic #define TE_BLOODSPRITE 115 #define TASK_STRIP 9991 #define TASK_NVISION 9992 #define TASK_ZIDLE 9993 #define TASK_HIDLE 9994 #define THUNDER_PRECHECK 9995 #define THUNDER 9996 #define fm_create_entity(%1) engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1)) new blood,blood2,dmgamount,dmgcolor; new bool:g_zombie[33] // is user zombie ??? new bool:g_spawned[33] = false// is user has spawned ??? new g_nvisionenabled[33] // is user turn on nightvision ??? new cvar_hlzm_enable,cvar_zombiehealth,cvar_zombiearmor,cvar_zombiespeed,cvar_zombiegravity,cvar_fs,cvar_night_enable, cvar_night_radius,cvar_night_red,cvar_night_green,cvar_night_blue,cvar_h_health,cvar_h_speed,cvar_h_gravity, cvar_h_armor,cvar_lighting,cvar_sky,cvar_zombieextrasound,cvar_zombieidle, cvar_lt, cvar_humanextrasound,cvar_humanidle,cvar_zombie_spawn,cvar_human_spawn; new modname[1996]; new zm_enabled = 1 new g_lights_reach; new g_thunder_randomswitch; // Awesome mercylezz thunder effects =0 new const lights_thunder1[][] = { "i" ,"j", "k", "l", "m", "n", "o", "n", "m", "l", "k", "j", "i", "h", "g", "f", "e", "d", "c", "b", "a"} new const lights_thunder2[][] = { "k", "l", "m", "l", "k", "j", "i", "h", "g", "f", "e", "d", "c", "b", "a", "a", "b", "c", "d", "e", "d", "c", "b", "a"} // Weapon entities new const g_weapon_ents[][] = { "weapon_357", "weapon_9mmAR", "weapon_9mmhandgun", "weapon_crossbow", "weapon_egon", "weapon_gauss", "weapon_glock", "weapon_handgrenade", "weapon_hornetgun", "weapon_mp5", "weapon_python", "weapon_rpg", "weapon_satchel", "weapon_shotgun", "weapon_snark", "weapon_tripmine", "item_longjump", "item_suit", "item_battery", "item_healthkit", "weaponbox" } // Item entities new const g_item_ents[][] = { "ammo_357", //"ammo_556", "ammo_9mmAR", "ammo_9mmbox", "ammo_9mmclip", "ammo_ARgrenades", "ammo_buckshot", "ammo_crossbow", "ammo_egonclip", "ammo_gaussclip", "ammo_glockclip", "ammo_mp5clip", "ammo_mp5grenades", "ammo_rpgclip", "item_longjump", "item_suit", "item_battery", "item_healthkit", "weaponbox" } // "Func" entities new const g_func_ents[][] = { "func_recharge", "func_healthcharger", "func_tank", "func_tankcontrols", "func_tanklaser", "func_tankmortar", "func_tankrocket", "monster_barney", "monster_scientist" } #if defined Opposing_Force // Weapon entities new const op4_weapon_ents[][] = { "weapon_displacer", // Opposing Force stuff "weapon_eagle", // Opposing Force stuff "weapon_grapple", // Opposing Force stuff "weapon_knife", // Opposing Force stuff "weapon_m249", // Opposing Force stuff "weapon_penguin", // Opposing Force stuff "weapon_pipewrench", // Opposing Force stuff "weapon_shockrifle", // Opposing Force stuff "weapon_shockroach", // Opposing Force stuff "weapon_sniperrifle", // Opposing Force stuff "weapon_sporelauncher" // Opposing Force stuff } // Item entities new const op4_item_ents[][] = { "ammo_762", // Opposing Force stuff "ammo_eagleclip", // Opposing Force stuff "ammo_spore", // Opposing Force stuff "item_vest" // Opposing Force stuff } // "Func" entities new const op4_func_ents[][] = { "monster_cleansuit_scientist", // Opposing Force stuff "monster_drillsergeant", // Opposing Force stuff "monster_grunt_ally_repel", // Opposing Force stuff "monster_medic_ally_repel", // Opposing Force stuff "monster_human_friendly_grunt", // Opposing Force stuff "monster_human_grunt_ally", // Opposing Force stuff "monster_human_medic_ally", // Opposing Force stuff "monster_human_torch_ally", // Opposing Force stuff "monster_otis" // Opposing Force stuff } #endif public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_cvar("hlzm_version", VERSION, FCVAR_SERVER|FCVAR_SPONLY) set_cvar_string("hlzm_version", VERSION) static i; RegisterHam(Ham_Spawn,"player","Hamspawn",1) RegisterHam(Ham_TakeDamage,"player","Hamtakedamage") RegisterHam(Ham_Killed, "player", "HamPlayerKilled") RegisterHam(Ham_BloodColor, "player", "ham_BloodColor") for(i=0;i 0.0 && !task_exists(THUNDER_PRECHECK) && !task_exists(THUNDER)) // if thunder enabled { g_lights_reach = 0 g_thunder_randomswitch = random_num(0,1) set_task(thunder_checkrate, "thundershow", THUNDER_PRECHECK) if (!task_exists(THUNDER)) engfunc(EngFunc_LightStyle, 0, thunders) } } public thundershow() { if (!g_lights_reach) emit_sound(0,CHAN_AUTO,g_ambience_thunder[random_num(0, sizeof g_ambience_thunder-1)],1.0,ATTN_NORM,0,PITCH_NORM) // Set lightstyle sequently switch (g_thunder_randomswitch) { case 0: { engfunc(EngFunc_LightStyle, 0, lights_thunder1[g_lights_reach]);} case 1: { engfunc(EngFunc_LightStyle, 0, lights_thunder2[g_lights_reach]);} } g_lights_reach++ if (g_lights_reach >= thunderchance()) { remove_task(THUNDER) thunder_check() } else if (!task_exists(THUNDER)) set_task(0.1, "thundershow", THUNDER, _, _, "b") } /* Stock */ public Task_Strip(taskman) { new id = taskman - TASK_STRIP //Fakemeta fm_strip_user_weapons(id) fm_give_item(id, "weapon_crowbar") set_pev(id, pev_viewmodel2, ZOMBIE_CLAWS) set_pev(id, pev_weaponmodel2, "") } stock fm_strip_user_weapons(index) { new ent = fm_create_entity("player_weaponstrip"); if (!pev_valid(ent)) return 0; dllfunc(DLLFunc_Spawn, ent); dllfunc(DLLFunc_Use, ent, index); engfunc(EngFunc_RemoveEntity, ent); return 1; } stock fm_give_item(index, const item[]) { new ent = fm_create_entity(item); if (!pev_valid(ent)) return 0; new Float:origin[3]; pev(index, pev_origin, origin); set_pev(ent, pev_origin, origin); set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN); dllfunc(DLLFunc_Spawn, ent); new save = pev(ent, pev_solid); dllfunc(DLLFunc_Touch, ent, index); if (pev(ent, pev_solid) != save) return ent; engfunc(EngFunc_RemoveEntity, ent); return -1; } // Custom Night Vision public set_user_nvision(taskid) { new id = taskid - TASK_NVISION // Zombie if (get_pcvar_num(cvar_night_enable) && g_zombie[id] && is_user_alive(id)) { // Get player's origin static origin[3] get_user_origin(id, origin) // Nightvision message message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, id) write_byte(TE_DLIGHT) // TE id write_coord(origin[0]) // x write_coord(origin[1]) // y write_coord(origin[2]) // z write_byte(get_pcvar_num(cvar_night_radius)) // radius write_byte(get_pcvar_num(cvar_night_red)) // r write_byte(get_pcvar_num(cvar_night_green)) // g write_byte(get_pcvar_num(cvar_night_blue)) // b write_byte(2) // life write_byte(0) // decay rate message_end() } } // Play idle zombie sounds, created by MercyLezz and edited by me public zombie_play_idle(taskid) { new id = taskid - TASK_ZIDLE // Not enable or not alive if (!get_pcvar_num(cvar_zombieextrasound) || !is_user_alive(id)) { remove_task(TASK_ZIDLE) return ; } // Zombie idle if (g_zombie[id]) emit_sound(id,CHAN_VOICE,g_zombie_idle_sounds[random_num(0,sizeof g_zombie_idle_sounds - 1)],1.0,ATTN_NORM,0,PITCH_NORM) } // Play idle human sounds public human_play_idle(taskid) { new id = taskid - TASK_HIDLE // Not enable or not alive if (!get_pcvar_num(cvar_humanextrasound) || !is_user_alive(id)) { remove_task(TASK_HIDLE) return ; } // Human idle if (!g_zombie[id]) emit_sound(id,CHAN_VOICE,g_human_idle_sounds[random_num(0,sizeof g_human_idle_sounds - 1)],1.0,ATTN_NORM,0,PITCH_NORM) } stock thunderchance() { switch (g_thunder_randomswitch) { case 0: return charsmax(lights_thunder1) case 1: return charsmax(lights_thunder2) } return false }