public Damage_spear(Ent)
{
static Owner; Owner = pev(Ent, pev_owner)
static Attacker
if(!is_user_alive(Owner))
{
Attacker = 0
return
} else Attacker = Owner
for(new i = 0; i < g_MaxPlayers; i++)
{
if(!is_user_alive(i))
continue
if(entity_range(i, Ent) > 100.0)
continue
if(!g_rightclick) ExecuteHamB(Ham_TakeDamage, i, 0, Attacker, get_pcvar_float(cvar_dmg1_spear), DMG_BULLET)
else ExecuteHamB(Ham_TakeDamage, i, 0, Attacker, get_pcvar_float(cvar_dmg2_spear), DMG_BULLET)
static Float:v_Velocity[3], Float:ori_Velocity[3]
pev(i, pev_velocity, ori_Velocity)
v_Velocity[0] = ori_Velocity[0]
v_Velocity[1] = ori_Velocity[1]
v_Velocity[2] = 230.0
entity_set_vector(i, EV_VEC_velocity, v_Velocity)
g_rightclick = 0
}
for(new i = 0; i < g_MaxPlayers; i++)
{
if(!is_user_alive(i))
continue
if(entity_range(i, Ent) > 200.0)
continue
if(!g_had_speargun[i])
continue
if(i != Owner)
continue
static Float:v_Velocity[3], Float:ori_Velocity[3]
pev(i, pev_velocity, ori_Velocity)
v_Velocity[0] = ori_Velocity[0]
v_Velocity[1] = ori_Velocity[1]
v_Velocity[2] = 250.0
entity_set_vector(i, EV_VEC_velocity, v_Velocity)
}
}