/* Choose your ZP version! */ #define ZOMBIE_PLAGUE //#define ZOMBIE_PLAGUE_ADVANCE /* Uncomment this, if you have warning 217 (loose indentation) Uncomment means to delete these 2 symbols "//" */ #define LOOSE_INDENTATION #include < amxmodx > #include < amxmisc > #if defined ZOMBIE_PLAGUE #include < zombieplague > #endif #if defined ZOMBIE_PLAGUE_ADVANCE #include < zombie_plague_advance > #endif #include < fakemeta_util > #include < hamsandwich > #include < fakemeta > #include < cstrike > #include < engine > #include < fun > #define PLUGIN "Zombie Classes" #define VERSION "1.0" #define AUTHOR "Doomsday" #if defined LOOSE_INDENTATION #pragma tabsize 0 #endif new jumpznum[33] = 0 new bool:dozjump[33], bool:g_hasLeap[33] new Float:g_heal_delay[33], Float:g_last_LongJump_time[33] new g_zclass_tight, g_zclass_healing, g_healing_delay, g_healing_amount, cvar_jumps, g_zclass_Leap, g_Leap_force, g_Leap_height , g_LongJump_cooldown new const leap_sound[] = { "zombie_plague/hunter_jump.wav" } new const zclass_name[] = "Tight Zombie" new const zclass_info[] = "Ability: \rDouble jump" new const zclass_model[] = "speed_zombi_host" new const zclass_clawmodel[] = "v_knife_witch.mdl" const zclass_health = 2400 const zclass_speed = 300 const Float:zclass_gravity = 0.8 const Float:zclass_knockback = 0.8 new const zclass2_name[] = "Regen Zombie" new const zclass2_info[] = "Ability: \dRegeneration" new const zclass2_model[] = "zombie_source1" new const zclass2_clawmodel[] = "v_knife_hunter.mdl" const zclass2_health = 2300 const zclass2_speed = 300 const Float:zclass2_gravity = 1.0 const Float:zclass2_knockback = 0.9 new const zclass3_name[] = "Hunter" new const zclass3_info[] = "Ability \rLong Jump" new const zclass3_model[] = "Hunter" new const zclass3_clawmodel[] = "v_hunter_claws.mdl" const zclass3_health = 2300 const zclass3_speed = 300 const Float:zclass3_gravity = 0.5 const Float:zclass3_knockback = 0.7 public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) cvar_jumps = register_cvar("zp_tight_zombie_jump","1") g_healing_delay = register_cvar("zp_healing_zombie_delay", "3.0") g_healing_amount = register_cvar("zp_healing_zombie_amount", "50.0") g_Leap_force = register_cvar("zp_zclass_leap_force", "400") g_Leap_height = register_cvar("zp_zclass_leap_height", "240") g_LongJump_cooldown = register_cvar("zp_longjump_cooldown", "5.0") register_event("Damage", "Damage", "be") register_forward(FM_PlayerPreThink, "fw_PlayerPreThink") register_forward(FM_PlayerPreThink, "fw_PlayerPreThink2") } public plugin_precache() { g_zclass_tight = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback) g_zclass_healing = zp_register_zombie_class(zclass2_name, zclass2_info, zclass2_model, zclass2_clawmodel, zclass2_health, zclass2_speed, zclass2_gravity, zclass2_knockback) g_zclass_Leap = zp_register_zombie_class(zclass3_name, zclass3_info, zclass3_model, zclass3_clawmodel, zclass3_health, zclass3_speed, zclass3_gravity, zclass3_knockback) precache_sound(leap_sound) } public client_putinserver(id) { jumpznum[id] = 0 dozjump[id] = false g_hasLeap[id] = false } public client_disconnect(id) { jumpznum[id] = 0 dozjump[id] = false g_hasLeap[id] = false } public zp_user_infected_post(player, infector) { if (zp_get_user_zombie_class(player) == g_zclass_Leap) g_hasLeap[player] = true return PLUGIN_CONTINUE } public zp_user_humanized_post(player) { g_hasLeap[player] = false jumpznum[player] = 0 dozjump[player] = false } public Damage(victim) { if(!pev_valid(victim)) return FMRES_IGNORED if (!is_user_alive(victim) || !zp_get_user_zombie(victim)) return PLUGIN_HANDLED if (zp_get_user_zombie_class(victim) != g_zclass_healing) return PLUGIN_CONTINUE static Float:g_gametime g_gametime = get_gametime() g_heal_delay[victim] = g_gametime + get_pcvar_float(g_healing_delay) return PLUGIN_CONTINUE } public client_PreThink(id) { if(!is_user_alive(id) || !zp_get_user_zombie(id)) return PLUGIN_CONTINUE if(zp_get_user_zombie_class(id) != g_zclass_tight) return PLUGIN_CONTINUE new nzbut = get_user_button(id) new ozbut = get_user_oldbutton(id) if((nzbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(ozbut & IN_JUMP)) { if (jumpznum[id] < get_pcvar_num(cvar_jumps)) { dozjump[id] = true jumpznum[id]++ return PLUGIN_CONTINUE } } if((nzbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND)) { jumpznum[id] = 0 return PLUGIN_CONTINUE } return PLUGIN_CONTINUE } public fw_PlayerPreThink(player) { if(!pev_valid(player)) return FMRES_IGNORED if (!is_user_alive(player) || !zp_get_user_zombie(player)) return FMRES_IGNORED if (zp_get_user_zombie_class(player) != g_zclass_healing) return FMRES_IGNORED static Float:g_gametime, Float:g_health g_gametime = get_gametime() pev(player, pev_health, g_health) if (g_health < zclass_health && g_heal_delay[player] < g_gametime) { set_pev(player, pev_health, g_health + get_pcvar_float(g_healing_amount)) g_heal_delay[player] = g_gametime + get_pcvar_float(g_healing_delay) } return FMRES_IGNORED } public client_PostThink(id) { if(!is_user_alive(id) || !zp_get_user_zombie(id)) return PLUGIN_CONTINUE if(zp_get_user_zombie_class(id) != g_zclass_tight) return PLUGIN_CONTINUE if(dozjump[id] == true) { new Float:vezlocityz[3] entity_get_vector(id,EV_VEC_velocity,vezlocityz) vezlocityz[2] = random_float(265.0,285.0) entity_set_vector(id,EV_VEC_velocity,vezlocityz) dozjump[id] = false return PLUGIN_CONTINUE } return PLUGIN_CONTINUE } public fw_PlayerPreThink2(id) { if(!is_user_connected(id)) return FMRES_IGNORED if(!pev_valid(id)) return FMRES_IGNORED new players players = get_maxplayers() if (!is_user_alive(id) || !zp_get_user_zombie(id)) return FMRES_IGNORED if (zp_get_user_zombie_class(id) != g_zclass_Leap && 1 <= id <= players ) { g_hasLeap[id] = false } if (allowed_Leap(id) && 1 <= id <= players) { g_hasLeap[id] = true static Float:velocity[3] velocity_by_aim(id, get_pcvar_num(g_Leap_force), velocity) velocity[2] = get_pcvar_float(g_Leap_height) set_pev(id, pev_velocity, velocity) g_last_LongJump_time[id] = get_gametime() emit_sound(id, CHAN_STREAM, leap_sound, 1.0, ATTN_NORM, 0, PITCH_HIGH ) } return FMRES_IGNORED } allowed_Leap(id) { if (!zp_get_user_zombie(id) || zp_get_user_zombie_class(id) != g_zclass_Leap) return false static buttons buttons = pev(id, pev_button) if (!(pev(id, pev_flags) & FL_ONGROUND) || fm_get_speed(id) < 20 || !(buttons & IN_JUMP) || !(buttons & IN_DUCK)) return false if (get_gametime() - g_last_LongJump_time[id] < get_pcvar_float(g_LongJump_cooldown)) return false return true }