If class x have own hp , grav and etc
If class x have own hp , grav , speed
PHP Code:
new const ZombieClass[][] = {
"0",
"1",
"2"
};
public fw_PlayerPreThink(id)
{
if(!is_user_alive(id))
return FMRES_IGNORED;
static Float: velocity[3], Float: Time
static button, flag
button = pev(id, pev_button)
flag = pev(id, pev_flags)
Time = get_gametime()
if (g_zombie[id] && PlayerClass[id] == 0)
{
if ( (!g_infreezetime) && (button & IN_DUCK) && (button & IN_ATTACK) && (flag & FL_ONGROUND))
{
static Float: cooldown, Float: lheight, lforce
cooldown = get_pcvar_float(cvar_cooldown)
lforce = get_pcvar_num(cvar_lforce)
lheight = get_pcvar_float(cvar_lheight)
if (Time - cooldown > g_LastLeap[id])
{
emit_sound(id, CHAN_ITEM, hunter_leap, 1.0, ATTN_NORM, 0, PITCH_NORM);
set_pev(id, pev_button, button & ~IN_ATTACK)
velocity_by_aim(id, lforce, velocity)
velocity[2] = lheight
set_pev(id, pev_velocity, velocity)
g_LastLeap[id] = Time
}
}
}
if (!g_infreezetime && g_zombie[id] && ZombieClass[id] == 0)
{
set_user_maxspeed(id, 280.0)
set_user_health(id, 600)
set_user_gravity(id, 0.7)
}
else if (!g_infreezetime && g_zombie[id] && PlayerClass[id] == 1)
{
set_user_maxspeed(id, 255.0)
set_user_health(id, 700)
set_user_gravity(id, 0.8)
}
else if (!g_infreezetime && g_zombie[id] && PlayerClass[id] == 2)
{
set_user_maxspeed(id, 250.0)
set_user_health(id, 300)
set_user_gravity(id, 0.9)
}
return FMRES_IGNORED
}
|