Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help How to use custom wepaon files in a mod?
#11
stop punching mah salad!

btw: push
Reply

#12
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

Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Black Ops 2 Custom background? jotape99 10 12,461 10-29-2013, 07:22
Last Post: xInfinity.
  Help mod not reading .iwd files? hmann 4 4,541 10-13-2013, 20:14
Last Post: hmann
  i need help with the sabs files duckywson 2 3,349 08-31-2013, 19:46
Last Post: duckywson
  Custom xanims DidUknowiPwn 8 7,080 08-28-2013, 08:17
Last Post: RaZ
  .FF Files tugay12 1 4,371 08-14-2013, 17:11
Last Post: DidUknowiPwn
Question Help Upgrade my point system from files to Database, help? EnVi Sweden Rocks 11 9,439 08-03-2013, 23:31
Last Post: EnVi Sweden Rocks
  Help GSC Reading Files?! Howl3r 11 8,401 07-30-2013, 04:00
Last Post: DidUknowiPwn
  Help Make ac130 shoot custom bullets Ra3shed 0 2,732 07-23-2013, 13:02
Last Post: Ra3shed
  [Tutorial] Custom gametype HUD iAegle 17 15,357 07-14-2013, 01:16
Last Post: Nekochan
Music [Release] [C#] [LIBRARY] SABSFile library (open sound files) JariZ 31 19,971 07-07-2013, 17:20
Last Post: Red-EyeX32

Forum Jump:


Users browsing this thread:
1 Guest(s)

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