Nemesis attack speed bug Jul 20, 2021 10:39:05 GMT Quote Select PostDeselect PostLink to PostMemberGive GiftBack to Top Post by garklavs on Jul 20, 2021 10:39:05 GMT I've merged these two plugins together and the Nemesis now has increased attack speed whenever the zombie class is selected.leap zombie and attack speed zombieP.S. Attack speed buff stays on the Nemesis until you die even if you select another zombie class.UPD. I fixed it, thankspublic fw_PlayerPreThink(id){ if (!is_user_alive(id) || !zp_get_user_zombie(id)) return FMRES_IGNORED if (zp_get_user_zombie_class(id) != g_zclass_Leap) { g_hasLeap[id] = false } if (allowed_Leap(id) && !zp_get_user_nemesis(id)) <---------------- { 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() } return FMRES_IGNORED}
Nemesis attack speed bug Jul 20, 2021 11:07:40 GMT garklavs likes this Quote Select PostDeselect PostLink to PostMemberGive GiftBack to Top Post by spaghettiman on Jul 20, 2021 11:07:40 GMT Try this#include <amxmodx>#include <fakemeta>#include <hamsandwich>#include <zombieplague>#define PLUGIN "[ZP] Class : Leap Zombie"#define VERSION "1.4.2"#define AUTHOR "Fry!"new const zclass_name[] = "Hunter"new const zclass_info[] = "| Leap [CTRL+SPACE]"new const zclass_model[] = "tank_zombi_host"new const zclass_clawmodel[] = "v_knife_tank_zombi.mdl"const zclass_health = 2000const zclass_speed = 320const Float:zclass_gravity = 0.7const Float:zclass_knockback = 2.0const OFFSET_WEAPONOWNER = 41const OFFSET_LINUX_WEAPONS = 4const m_flNextPrimaryAttack = 46const m_flNextSecondaryAttack = 47new g_iMaxPlayersnew bool:g_hasLeap[33]new Float:g_last_LongJump_time[33]new g_zclass_Leap, g_Leap_force, g_Leap_height, g_LongJump_cooldown, cvar_Primary, cvar_PrimarySpeed, cvar_Secondary, cvar_SecondarySpeedpublic plugin_precache(){ g_zclass_Leap = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)}public plugin_init(){ register_plugin(PLUGIN, VERSION, AUTHOR) register_event("HLTV", "event_round_start", "a", "1=0", "2=0") register_event("DeathMsg", "event_player_death", "a") RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_knife", "fwd_Knife_PriAtk_Post", 1) RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_knife", "fwd_Knife_SecAtk_Post", 1) cvar_Primary = register_cvar("zp_executioner_pri", "1") cvar_PrimarySpeed = register_cvar("zp_executioner_pri_speed", "0.70") cvar_Secondary = register_cvar("zp_executioner_sec", "1") cvar_SecondarySpeed = register_cvar("zp_executioner_sec_speed", "0.70") register_cvar("zp_zclass_leap_zombie",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY) g_Leap_force = register_cvar("zp_zclass_leap_force", "600") g_Leap_height = register_cvar("zp_zclass_leap_height", "300") g_LongJump_cooldown = register_cvar("zp_longjump_cooldown", "0.25") register_forward(FM_PlayerPreThink, "fw_PlayerPreThink") g_iMaxPlayers = get_maxplayers()}public event_round_start(){ for (new id = 1; id <= g_iMaxPlayers; id++) g_hasLeap[id] = false}public event_player_death() g_hasLeap[read_data(2)] = falsepublic client_connect(id){ g_hasLeap[id] = false}public zp_user_infected_post(id, infector){ if (zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_Leap) g_hasLeap[id] = true}public zp_user_humanized_post(player){ g_hasLeap[player] = false}public fw_PlayerPreThink(id){ if (!is_user_alive(id) || !zp_get_user_zombie(id)) return FMRES_IGNORED if (zp_get_user_zombie_class(id) != g_zclass_Leap) g_hasLeap[id] = false if (allowed_Leap(id)) { 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() } return FMRES_IGNORED}public fwd_Knife_PriAtk_Post(ent){ if (!get_pcvar_num(cvar_Primary)) return HAM_IGNORED static owner owner = ham_cs_get_weapon_ent_owner(ent) if(zp_get_user_nemesis(owner)) return HAM_IGNORED; if (!g_hasLeap[owner]) return HAM_IGNORED static Float:Speed, Float:Primary, Float:Secondary Speed = get_pcvar_float(cvar_PrimarySpeed) Primary = get_pdata_float(ent, m_flNextPrimaryAttack, OFFSET_LINUX_WEAPONS) * Speed Secondary = get_pdata_float(ent, m_flNextSecondaryAttack, OFFSET_LINUX_WEAPONS) * Speed if (Primary > 0.0 && Secondary > 0.0) { set_pdata_float(ent, m_flNextPrimaryAttack, Primary, OFFSET_LINUX_WEAPONS) set_pdata_float(ent, m_flNextSecondaryAttack, Secondary, OFFSET_LINUX_WEAPONS) } return HAM_IGNORED;}public fwd_Knife_SecAtk_Post(ent){ if (!get_pcvar_num(cvar_Secondary)) return HAM_IGNORED; static owner owner = ham_cs_get_weapon_ent_owner(ent) if(zp_get_user_nemesis(owner)) return HAM_IGNORED; if (!g_hasLeap[owner]) return HAM_IGNORED static Float:Speed, Float:Primary, Float:Secondary Speed = get_pcvar_float(cvar_SecondarySpeed) Primary = get_pdata_float(ent, m_flNextPrimaryAttack, OFFSET_LINUX_WEAPONS) * Speed Secondary = get_pdata_float(ent, m_flNextSecondaryAttack, OFFSET_LINUX_WEAPONS) * Speed if (Primary > 0.0 && Secondary > 0.0) { set_pdata_float(ent, m_flNextPrimaryAttack, Primary, OFFSET_LINUX_WEAPONS) set_pdata_float(ent, m_flNextSecondaryAttack, Secondary, OFFSET_LINUX_WEAPONS) } return HAM_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}stock fm_get_speed(entity){ static Float:velocity[3] pev(entity, pev_velocity, velocity) return floatround(vector_length(velocity))}stock ham_cs_get_weapon_ent_owner(entity){ return get_pdata_cbase(entity, OFFSET_WEAPONOWNER, OFFSET_LINUX_WEAPONS);}
Nemesis attack speed bug Jul 20, 2021 11:12:13 GMT Quote Select PostDeselect PostLink to PostMemberGive GiftBack to Top Post by garklavs on Jul 20, 2021 11:12:13 GMT (113) : error 017: undefined symbol "id"(141) : error 017: undefined symbol "id"
Nemesis attack speed bug Jul 20, 2021 11:15:27 GMT Quote Select PostDeselect PostLink to PostMemberGive GiftBack to Top Post by garklavs on Jul 20, 2021 11:15:27 GMT I added this and the Nemesis doesn't have attack speed boost until he leaps.public zp_user_infected_post(id, infector){ if (zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_Leap && !zp_get_user_nemesis(id)) { g_hasLeap[id] = true }}
Nemesis attack speed bug Jul 20, 2021 11:56:00 GMT garklavs likes this Quote Select PostDeselect PostLink to PostMemberGive GiftBack to Top Post by spaghettiman on Jul 20, 2021 11:56:00 GMT i just edited the code try it now
Nemesis attack speed bug Jul 20, 2021 12:01:06 GMT Quote Select PostDeselect PostLink to PostMemberGive GiftBack to Top Post by garklavs on Jul 20, 2021 12:01:06 GMT That also works. Thank you.