I put this together to change the weapons dmg on range and hitlocation
I tested this with many changes but sHitLoc or break; or something else won't work as it should. I can do these Headshots and they work very well, but when I shot torso or other locations i get a hitmarker, but do no dmg at all. the target becomes 0 hitmarker at all, when shot everything else then head. i worked hours on that to figure out how to balance ak and aku on range and close..... but damn....there must be a mistake that i don't see
some more infos. i put this in _globallogic_player.gsc under Callback_PlayerDamage( ) function
do i need to put something in _damage.gsc in the getHitLoc( ) function to make it work correctly?
Code:
// Range Var
range = int(distance(self.origin, eAttacker.origin));
// Aku Dmg modify
if(range <= 3000 && range > 0 && (isSubStr(sWeapon, "ak74u_")))
{
switch( sHitLoc )
{
case "helmet":
case "neck":
case "head":
n = RandomInt(18);
iDamage = 65 + n;
break;
case "torso_upper":
case "torso_lower":
case "right_arm_upper":
case "left_arm_upper":
case "right_arm_lower":
case "left_arm_lower":
case "right_leg_upper":
case "left_leg_upper":
case "right_leg_lower":
case "left_leg_lower":
iDamage = (-0.0033333 * range) + 34;
break;
case "right_hand":
case "left_hand":
case "right_foot":
case "left_foot":
iDamage = 10;
break;
case "gun":
iDamage = 0;
break;
}else
if(range > 3000 && (isSubStr(sWeapon, "ak74u_")))
{
switch( sHitLoc )
{
case "helmet":
case "neck":
case "head":
n = RandomInt(10);
iDamage = 65 + n;
break;
case "torso_upper":
case "torso_lower":
case "right_arm_upper":
case "left_arm_upper":
case "right_arm_lower":
case "left_arm_lower":
case "right_leg_upper":
case "left_leg_upper":
case "right_leg_lower":
case "left_leg_lower":
iDamage = 24;
break;
case "right_hand":
case "left_hand":
case "right_foot":
case "left_foot":
iDamage = 5;
break;
case "gun":
iDamage = 0;
break;
}
}else if(range <= 3000 && range > 0 && (isSubStr(sWeapon, "ak47_"))) //AK Headshot does more Dmg
{
switch( sHitLoc )
{
case "helmet":
case "neck":
case "head":
n = RandomInt(15);
iDamage = 95 + n;
break;
case "torso_upper":
case "torso_lower":
case "right_arm_upper":
case "left_arm_upper":
case "right_arm_lower":
case "left_arm_lower":
case "right_leg_upper":
case "left_leg_upper":
case "right_leg_lower":
case "left_leg_lower":
iDamage = (-0.0033333 * range) + 44;
break;
case "right_hand":
case "left_hand":
case "right_foot":
case "left_foot":
iDamage = 10;
break;
case "gun":
iDamage = 0;
break;
}
}else
if(range > 3000 && (isSubStr(sWeapon, "ak47_")))
{
switch( sHitLoc )
{
case "helmet":
case "neck":
case "head":
n = RandomInt(7);
iDamage = 95 + n;
break;
case "torso_upper":
case "torso_lower":
iDamage = 35;
break;
case "right_arm_upper":
case "left_arm_upper":
case "right_arm_lower":
case "left_arm_lower":
case "right_leg_upper":
case "left_leg_upper":
case "right_leg_lower":
case "left_leg_lower":
iDamage = 30;
break;
case "right_hand":
case "left_hand":
case "right_foot":
case "left_foot":
iDamage = 5;
break;
case "gun":
iDamage = 0;
break;
}
}
I tested this with many changes but sHitLoc or break; or something else won't work as it should. I can do these Headshots and they work very well, but when I shot torso or other locations i get a hitmarker, but do no dmg at all. the target becomes 0 hitmarker at all, when shot everything else then head. i worked hours on that to figure out how to balance ak and aku on range and close..... but damn....there must be a mistake that i don't see
some more infos. i put this in _globallogic_player.gsc under Callback_PlayerDamage( ) function
do i need to put something in _damage.gsc in the getHitLoc( ) function to make it work correctly?