Code
iSkillLevel = SM_GetSkillLevel( iAttacker, SKILL_IMPALE );
if ( iSkillLevel > 0 )
{
if(get_user_team(iAttacker)==1)
{
if ( random_float(MIN_PERCENT_IMPALE, MAX_PERCENT_IMPALE ) <= p_impale[iSkillLevel-1] / 2 )
{
// Play the impale sound
emit_sound( iVictim, CHAN_STATIC, g_szSounds[SOUND_IMPALE], 1.0, ATTN_NORM, 0, PITCH_NORM );
new Float:vVelocity[3];
entity_get_vector( iVictim, EV_VEC_velocity, vVelocity );
vVelocity[0] = random_float(100.0, 400.0 );
vVelocity[1] = random_float(100.0, 400.0 );
vVelocity[2] = random_float(400.0, 700.0 );
entity_set_vector( iVictim, EV_VEC_velocity, vVelocity );
}
}
else
{
if ( random_float(MIN_PERCENT_IMPALE, MAX_PERCENT_IMPALE ) <= p_impale[iSkillLevel-1] )
{
// Play the impale sound
emit_sound( iVictim, CHAN_STATIC, g_szSounds[SOUND_IMPALE], 1.0, ATTN_NORM, 0, PITCH_NORM );
new Float:vVelocity[3];
entity_get_vector( iVictim, EV_VEC_velocity, vVelocity );
vVelocity[0] = random_float(100.0, 400.0 );
vVelocity[1] = random_float(100.0, 400.0 );
vVelocity[2] = random_float(400.0, 700.0 );
entity_set_vector( iVictim, EV_VEC_velocity, vVelocity );
}
}
}