The model that I shall not see me, let him. sma
The plugin autor is fry! (zp extra class leap zombie)
I just want to modify models
PHP Code:
*
[ZP] Class : Leap Zombie
(new zombie class)
by Fry!
Description :
So what can I say? This is usual Zombie class but this zombie will have long jump already. (without delay)
Cvars :
zp_zclass_leap_force "570" - How far zombie will jump
zp_zclass_leap_height "275" - How heigh zombie will jump
Changelog :
04/10/2008 - v1.0 - First release
05/10/2008 - v1.1 - fixed bug that cause long jump to all zombie classes...
10/10/2008 - v1.2 - fixed again this bug from v1.1
18/10/2008 - v1.2.1 - removed chat message.
12/11/2008 - v1.2.2 - changed plugin name.
15/11/2008 - v1.3 - added ability that this class can now use how high and how far can jump.
18/11/2008 - v1.3.2 - fixed that longjump was given to all zombie classes, removed fun module.
19/11/2008 - v1.3.3 - somehow forgat to remove fun module because using fakemeta instead.
19/11/2008 - v1.3.4 - possiblity that after few rounds long jump not working anymore so I put back fun module...
28/12/2008 - v1.3.6 - completely fixed long jump and removed fun module again.
20/02/2009 - v1.3.9 - fixed leap was after player humanized, changed plugin name. optimized code by removing fm_give_item.
21/07/2009 - v1.4.1 - fixed leap was broken sometimes, optimized code.
*/
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
#define PLUGIN "[ZP] Class : Hunter Zombie"
#define VERSION "1.4.1"
#define AUTHOR "Fry!"
new const zclass_name[] = "Hunter Zombie"
new const zclass_info[] = "[Left 4 dead] Hunter"
new const zclass_model[] = "huntermodel"
new const zclass_clawmodel[] = "HunterZ.mdl"
const zclass_health = 2200
const zclass_speed = 300
const Float:zclass_gravity = 0.5
const Float:zclass_knockback = 1.7
new bool:g_hasLeap[33]
new g_zclass_Leap, g_Leap_force, g_Leap_height
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("zp_zclass_leap_zombie",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
g_Leap_force = register_cvar("zp_zclass_leap_force", "570")
g_Leap_height = register_cvar("zp_zclass_leap_height", "275")
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
}
public 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 client_connect(id)
{
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
}
public fw_PlayerPreThink(id)
{
if (!is_user_alive(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)
}
return FMRES_IGNORED
}
allowed_Leap(id)
{
if (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
return true
}
stock fm_get_speed(entity)
{
static Float:velocity[3]
pev(entity, pev_velocity, velocity)
return floatround(vector_length(velocity))
}