PHP Code:
fire_player(victim)
{
// Get origin
static Float:originF[3]
pev(victim, pev_origin, originF)
// Fire nade explode sound
engfunc(EngFunc_EmitSound, victim, CHAN_WEAPON, grenade_fire_player[random_num(0, sizeof grenade_fire_player - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM)
// Only effect alive zombies
if (!is_user_alive(victim) || !g_zombie[victim] || g_nodamage[victim])
return;
// Heat icon?
if (get_pcvar_num(cvar_hudicons))
{
message_begin(MSG_ONE_UNRELIABLE, g_msgDamage, _, victim)
write_byte(0) // damage save
write_byte(0) // damage take
write_long(DMG_BURN) // damage type
write_coord(0) // x
write_coord(0) // y
write_coord(0) // z
message_end()
}
// Our task params
static params[1]
if (g_nemesis[victim]) // fire duration (nemesis takes less)
params[0] = get_pcvar_num(cvar_fireduration)
else
params[0] = get_pcvar_num(cvar_fireduration)*5
// Set burning task on victim
set_task(0.1, "burning_flame", victim+TASK_BLOOD, params, sizeof params)
}
frost_man(victim)
{
// Nemesis shouldn't be frozen
if (g_nemesis[victim])
{
// Get player's origin
static Float:origin2F[3]
pev(victim, pev_origin, origin2F)
// Broken glass sound
engfunc(EngFunc_EmitSound, victim, CHAN_BODY, grenade_frost_break[random_num(0, sizeof grenade_frost_break - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM)
// Glass shatter
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin2F, 0)
write_byte(TE_BREAKMODEL) // TE id
engfunc(EngFunc_WriteCoord, origin2F[0]) // x
engfunc(EngFunc_WriteCoord, origin2F[1]) // y
engfunc(EngFunc_WriteCoord, origin2F[2]+24.0) // z
write_coord(16) // size x
write_coord(16) // size y
write_coord(16) // size z
write_coord(random_num(-50, 50)) // velocity x
write_coord(random_num(-50, 50)) // velocity y
write_coord(25) // velocity z
write_byte(10) // random velocity
write_short(g_glassSpr) // model
write_byte(10) // count
write_byte(25) // life
write_byte(BREAK_GLASS) // flags
message_end()
}
// Get origin
static Float:originF[3]
pev(victim, pev_origin, originF)
// Frost nade explode sound
engfunc(EngFunc_EmitSound, victim, CHAN_WEAPON, grenade_frost[random_num(0, sizeof grenade_frost - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM)
// Only effect alive unfrozen zombies
if (!is_user_alive(victim) || !g_zombie[victim] || g_frozen[victim] || g_nodamage[victim])
return;
// Freeze icon?
if (get_pcvar_num(cvar_hudicons))
{
message_begin(MSG_ONE_UNRELIABLE, g_msgDamage, _, victim)
write_byte(0) // damage save
write_byte(0) // damage take
write_long(DMG_DROWN) // damage type - DMG_FREEZE
write_coord(0) // x
write_coord(0) // y
write_coord(0) // z
message_end()
}
// Light blue glow while frozen
#if defined HANDLE_MODELS_ON_SEPARATE_ENT
fm_set_rendering(g_ent_playermodel[victim], kRenderFxGlowShell, 0, 150, 250, kRenderNormal, 1)
#else
fm_set_rendering(victim, kRenderFxGlowShell, 0, 150, 250, kRenderNormal, 1)
#endif
// Freeze sound
engfunc(EngFunc_EmitSound, victim, CHAN_BODY, grenade_frost_player[random_num(0, sizeof grenade_frost_player - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM)
// Get freeze duration setting
static Float:freezeduration
freezeduration = get_pcvar_float(cvar_freezeduration)
// Add a blue tint to their screen
message_begin(MSG_ONE_UNRELIABLE, g_msgScreenFade, _, victim)
write_short(UNIT_SECOND*1) // duration
write_short(floatround(UNIT_SECOND*freezeduration)) // hold time
write_short(FFADE_IN) // fade type
write_byte(0) // red
write_byte(50) // green
write_byte(200) // blue
write_byte(100) // alpha
message_end()
// Prevent from jumping
if (pev(victim, pev_flags) & FL_ONGROUND)
set_pev(victim, pev_gravity, 999999.9) // set really high
else
set_pev(victim, pev_gravity, 0.000001) // no gravity
// Set a task to remove the freeze
g_frozen[victim] = true;
set_task(freezeduration/2, "remove_freeze", victim)
}