Post by zmd94 on May 16, 2016 15:53:29 GMT
Just change below:
-->
public fw_traceattack(victim, attacker, Float:damage, Float:direction[3], tr, damagebits)
{
new hitzone
hitzone = get_tr2(tr,TR_iHitgroup)
damage *= vec_hit_multi[hitzone]
new Float:origin[3]
pev(attacker,pev_origin,origin)
new use_strength
use_strength = 0
if (is_user_player(attacker))
{
// Strength Mode
if (get_pcvar_num(pcv_nn_ff))
{
if (cs_get_user_team(victim) == cs_get_user_team(attacker))
{
damage /= 2.0
use_strength = 2
}
else
{
use_strength = 1
}
}
else
{
if (cs_get_user_team(victim) == cs_get_user_team(attacker))
{
if (get_pcvar_num(pcv_nn_st_can_th))
use_strength = 1
}
else
{
use_strength = 1
}
}
if (use_strength && cl_nn_has[attacker] == NANO_YES && cl_nn_mode[attacker] == NANO_STREN && CSW_KNIFE == cl_nn_weapon[attacker])
{
damage *= 4.0
if (cl_nn_st_knife[attacker] == KNIFE_FIRST_ATTACK)
{
new Float:origin[3], Float:origin2[3], Float:throw[3], Float:aimvel[3]
// Get the origin of attacker and victim
pev(victim,pev_origin,origin)
pev(attacker,pev_origin,origin2)
velocity_by_aim(attacker,2,aimvel)
// We need to make a vector between them and we multiply it's value so we can make it powerfull
xs_vec_sub(origin,origin2,throw)
xs_vec_div_scalar(throw,xs_vec_len(throw),throw)
xs_vec_add(throw,aimvel,throw)
xs_vec_div_scalar(throw,xs_vec_len(throw),throw)
throw[2] += 0.6
xs_vec_mul_scalar(throw,get_pcvar_float(pcv_nn_st_throw),throw)
// We add it to the velocity so we can make it a throw
set_pev(victim,pev_velocity,throw)
// We block the speed of the player so he can't influence the direction of the throw (too much :P)
set_user_maxspeed(victim, 1.0)
cl_is_thrown[victim] = attacker
set_pev(victim,pev_flags,pev(victim,pev_flags) & ~FL_ONGROUND)
}
cl_nn_st_knife[attacker] = KNIFE_NOT
}
}
// Armor Mode
if ((!is_user_player(attacker)) || (get_pcvar_num(pcv_nn_ff) || ((!get_pcvar_num(pcv_nn_ff) && cs_get_user_team(victim) != cs_get_user_team(attacker)))))
{
if ((get_tr2(tr,TR_iHitgroup) != 8) && cl_nn_has[victim] == NANO_YES && cl_nn_mode[victim] == NANO_ARMOR)
{
damage *= get_pcvar_float(pcv_nn_ar_damage)
if (damage < cl_nn_energy[victim])
{
set_nano_energy(victim, cl_nn_energy[victim] - damage, DELAY_ARM_DAMAGE)
set_tr2(tr,TR_iHitgroup,8)
static Float:vec_end_pos[3]
get_tr2(tr,TR_vecEndPos,vec_end_pos)
if (hitzone != HIT_GENERIC)
draw_spark(vec_end_pos)
if (random(2) > 0)
{
engfunc(EngFunc_EmitSound,victim,CHAN_AUTO,sound_ric_metal1, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}
else
{
engfunc(EngFunc_EmitSound,victim,CHAN_AUTO,sound_ric_metal2, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}
set_pev(victim,pev_dmg_inflictor,attacker)
emsg_damage(victim,0,floatround(damage),damagebits,origin)
damage = 0.0
}
else
{
damage -= cl_nn_energy[victim]
set_nano_energy(victim, 0.0, DELAY_ARM_DAMAGE)
}
}
}
if (use_strength == 2)
damage *= 2.0
if (hitzone != 8 && damage != 0.0)
damage /= vec_hit_multi[hitzone]
SetHamParamTraceResult(5,tr)
SetHamParamFloat(3,damage)
return HAM_HANDLED
}
-->
public fw_traceattack(victim, attacker, Float:damage, Float:direction[3], tr, damagebits)
{
if(!is_user_alive(victim) || !is_user_alive(attacker) || attacker == victim)
return HAM_IGNORED
new hitzone
hitzone = get_tr2(tr,TR_iHitgroup)
damage *= vec_hit_multi[hitzone]
new Float:origin[3]
pev(attacker,pev_origin,origin)
new use_strength
use_strength = 0
if (is_user_player(attacker))
{
// Strength Mode
if (get_pcvar_num(pcv_nn_ff))
{
if (cs_get_user_team(victim) == cs_get_user_team(attacker))
{
damage /= 2.0
use_strength = 2
}
else
{
use_strength = 1
}
}
else
{
if (cs_get_user_team(victim) == cs_get_user_team(attacker))
{
if (get_pcvar_num(pcv_nn_st_can_th))
use_strength = 1
}
else
{
use_strength = 1
}
}
if (use_strength && cl_nn_has[attacker] == NANO_YES && cl_nn_mode[attacker] == NANO_STREN && CSW_KNIFE == cl_nn_weapon[attacker])
{
damage *= 4.0
if (cl_nn_st_knife[attacker] == KNIFE_FIRST_ATTACK)
{
new Float:origin[3], Float:origin2[3], Float:throw[3], Float:aimvel[3]
// Get the origin of attacker and victim
pev(victim,pev_origin,origin)
pev(attacker,pev_origin,origin2)
velocity_by_aim(attacker,2,aimvel)
// We need to make a vector between them and we multiply it's value so we can make it powerfull
xs_vec_sub(origin,origin2,throw)
xs_vec_div_scalar(throw,xs_vec_len(throw),throw)
xs_vec_add(throw,aimvel,throw)
xs_vec_div_scalar(throw,xs_vec_len(throw),throw)
throw[2] += 0.6
xs_vec_mul_scalar(throw,get_pcvar_float(pcv_nn_st_throw),throw)
// We add it to the velocity so we can make it a throw
set_pev(victim,pev_velocity,throw)
// We block the speed of the player so he can't influence the direction of the throw (too much :P)
set_user_maxspeed(victim, 1.0)
cl_is_thrown[victim] = attacker
set_pev(victim,pev_flags,pev(victim,pev_flags) & ~FL_ONGROUND)
}
cl_nn_st_knife[attacker] = KNIFE_NOT
}
}
// Armor Mode
if ((!is_user_player(attacker)) || (get_pcvar_num(pcv_nn_ff) || ((!get_pcvar_num(pcv_nn_ff) && cs_get_user_team(victim) != cs_get_user_team(attacker)))))
{
if ((get_tr2(tr,TR_iHitgroup) != 8) && cl_nn_has[victim] == NANO_YES && cl_nn_mode[victim] == NANO_ARMOR)
{
damage *= get_pcvar_float(pcv_nn_ar_damage)
if (damage < cl_nn_energy[victim])
{
set_nano_energy(victim, cl_nn_energy[victim] - damage, DELAY_ARM_DAMAGE)
set_tr2(tr,TR_iHitgroup,8)
static Float:vec_end_pos[3]
get_tr2(tr,TR_vecEndPos,vec_end_pos)
if (hitzone != HIT_GENERIC)
draw_spark(vec_end_pos)
if (random(2) > 0)
{
engfunc(EngFunc_EmitSound,victim,CHAN_AUTO,sound_ric_metal1, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}
else
{
engfunc(EngFunc_EmitSound,victim,CHAN_AUTO,sound_ric_metal2, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}
set_pev(victim,pev_dmg_inflictor,attacker)
emsg_damage(victim,0,floatround(damage),damagebits,origin)
damage = 0.0
}
else
{
damage -= cl_nn_energy[victim]
set_nano_energy(victim, 0.0, DELAY_ARM_DAMAGE)
}
}
}
if (use_strength == 2)
damage *= 2.0
if (hitzone != 8 && damage != 0.0)
damage /= vec_hit_multi[hitzone]
SetHamParamTraceResult(5,tr)
SetHamParamFloat(3,damage)
return HAM_HANDLED
}