Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help balance weapon dmg on range and distance
#1
Exclamation 
I put this together to change the weapons dmg on range and hitlocation

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 Angry

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?
Reply

#2
try this:
http://alteriw.net/viewtopic.php?f=72&t=70088

its mw2, but its should work fine on black ops aswell

remove the */ and /*

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; */
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#3
yeah i know i know. sorry this code was from testing something and i forgot to remove the */ things. that was NOT the problem. it's something else, but thx anyways.

hopefully someone will test this and figure out whats wrong


edit: 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?
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Question Help Mw2 weapon skin question FroxIVx4 1 2,939 10-13-2013, 16:54
Last Post: hmann
Question Help Weapon Name iRoNinja 8 6,560 10-08-2013, 08:31
Last Post: iRoNinja
  Help How to disable auto balance? .sepultura. 3 4,278 10-07-2013, 19:44
Last Post: Nekochan
  Mw2 weapon porting? Cuddlyedits 3 4,703 09-15-2013, 16:43
Last Post: DidUknowiPwn
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 33,121 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
  [Request] Request for !afk and !balance plugins. UlTiiMaTuM 3 3,551 09-10-2013, 02:13
Last Post: UlTiiMaTuM
Exclamation [Request] Random Weapon At Spawn Scripts18 3 4,716 07-27-2013, 23:53
Last Post: DidUknowiPwn
  Help Mw2 weapon skin question FroxIVx4 1 2,907 07-06-2013, 19:22
Last Post: surtek
  [Request] List of all weapon models DidUknowiPwn 3 4,614 04-20-2013, 09:13
Last Post: Dominator56
  [Release] !weapon Plugin 8q4s8 40 25,501 03-24-2013, 17:02
Last Post: X-Track

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.