/*
CVARS:
zp_tight_jump 2 (Default)
zp_hunter_autojump 1 (Deafult)
zp_hunter_bunnyhop_enabled 1 (Default)
*/
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#if defined _zombieplague_included
#endinput
#endif
#define _zombieplague_included
#define ZP_TEAM_ZOMBIE (1<<0)
#define ZP_TEAM_HUMAN (1<<1)
#define ZP_TEAM_NEMESIS (1<<2)
#define ZP_TEAM_SURVIVOR (1<<3)
enum
{
MODE_INFECTION = 1,
MODE_NEMESIS,
MODE_SURVIVOR,
MODE_SWARM,
MODE_MULTI,
MODE_PLAGUE
}
enum
{
WIN_NO_ONE = 0,
WIN_ZOMBIES,
WIN_HUMANS
}
#define ZP_PLUGIN_HANDLED 97
native zp_get_user_zombie(id)
native zp_get_user_nemesis(id)
native zp_get_user_survivor(id)
native zp_get_user_first_zombie(id)
native zp_get_user_last_zombie(id)
native zp_get_user_last_human(id)
native zp_get_user_zombie_class(id)
native zp_get_user_next_class(id)
native zp_set_user_zombie_class(id, classid)
native zp_get_user_ammo_packs(id)
native zp_set_user_ammo_packs(id, amount)
native zp_get_zombie_maxhealth(id)
native zp_get_user_batteries(id)
native zp_set_user_batteries(id, charge)
native zp_get_user_nightvision(id)
native zp_set_user_nightvision(id, set)
native zp_infect_user(id, infector = 0, silent = 0, rewards = 0)
native zp_disinfect_user(id, silent = 0)
native zp_make_user_nemesis(id)
native zp_make_user_survivor(id)
native zp_respawn_user(id, team)
native zp_force_buy_extra_item(id, itemid, ignorecost = 0)
native zp_override_user_model(id, const newmodel[], modelindex = 0)
native zp_has_round_started()
native zp_is_nemesis_round()
native zp_is_survivor_round()
native zp_is_swarm_round()
native zp_is_plague_round()
native zp_get_zombie_count()
native zp_get_human_count()
native zp_get_nemesis_count()
native zp_get_survivor_count()
native zp_register_extra_item(const name[], cost, teams)
native zp_register_zombie_class(const name[], const info[], const model[], const clawmodel[], hp, speed, Float:gravity, Float:knockback)
native zp_get_extra_item_id(const name[])
native zp_get_zombie_class_id(const name[])
native zp_get_zombie_class_info(classid, info[], len)
forward zp_round_started(gamemode, id)
forward zp_round_ended(winteam)
forward zp_user_infected_pre(id, infector, nemesis)
forward zp_user_infected_post(id, infector, nemesis)
forward zp_user_humanized_pre(id, survivor)
forward zp_user_humanized_post(id, survivor)
forward zp_user_infect_attempt(id, infector, nemesis)
forward zp_user_humanize_attempt(id, survivor)
forward zp_extra_item_selected(id, itemid)
forward zp_user_unfrozen(id)
forward zp_user_last_zombie(id)
forward zp_user_last_human(id)
#define ZP_TEAM_ANY 0
#define ZP_TEAM_NO_ONE 0
new jumpznum[33] = 0
new bool:dozjump[33] = false
new cvar_jumps
new g_zclass_tight
new g_hasBhop[ 33 ]
new pcvar_enabled, pcvar_autojump
new bool:g_restorevel[33]
new Float:g_velocity[33][3]
// Tight Zombi Atributes
new const zclass_name[] = { "Ugro Zombi" } // name
new const zclass_info[] = { "Nagy/Sok/Hosszu Ugras" } // description
new const zclass_model[] = { "zombie_source" } // model
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" } // claw model
const zclass_health = 9000 // health
const zclass_speed = 220 // speed
const Float:zclass_gravity = 0.4 // gravity
const Float:zclass_knockback = 1.5 // knockback
public plugin_init()
{
register_plugin("[ZP] Zombi Faj: Ugro Zombi", "1.0", "[Slayer]andrisgaming")
register_event( "DeathMsg", "event_player_death", "a" )
cvar_jumps = register_cvar("zp_tight_jump","2")
pcvar_enabled = register_cvar( "zp_hunter_bunnyhop_enabled", "1" )
pcvar_autojump = register_cvar( "zp_hunter_autojump", "1" )
register_forward( FM_PlayerPreThink, "forward_prethink" )
}
public plugin_precache()
{
g_zclass_ugro = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink_Post", 1)
}
public zp_user_infected_post(id, infector)
{
if (zp_get_user_zombie_class(id) == g_zclass_ugro)
{
g_hasBhop[ id ] = true
pev(id, pev_velocity, g_velocity[id])
give_item(id, "item_longjump");
}
}
public client_putinserver(id)
{
jumpznum[id] = 0
dozjump[id] = false
}
public client_disconnect(id)
{
jumpznum[id] = 0
dozjump[id] = false
}
public forward_prethink( id )
{
if(!is_user_alive(id) || !zp_get_user_zombie(id))
return PLUGIN_CONTINUE
if (zp_get_user_zombie_class(id) != g_zclass_ugro)
return PLUGIN_CONTINUE
if( get_pcvar_num( pcvar_enabled ) )
{
set_pev( id, pev_fuser2, 0.0 )
if( get_pcvar_num( pcvar_autojump ) && pev( id, pev_button ) & IN_JUMP )
{
new szFlags = pev( id, pev_flags )
if( !( szFlags & FL_WATERJUMP ) && pev( id, pev_waterlevel ) < 2 && szFlags & FL_ONGROUND )
{
new Float: szVelocity[ 3 ]
pev( id, pev_velocity, szVelocity)
szVelocity[ 2 ] += 250.0
set_pev( id, pev_velocity, szVelocity )
set_pev( id, pev_gaitsequence, 6 )
}
}
}
return FMRES_IGNORED
}
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_ugro) 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 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_ugro) 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
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/