ItsMods

Full Version: weapon damage?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
why is the ksg doing 400+ damage?? the snipers all work as they should except the shotties?

Code:
if (Weapon.Contains("l96a1"))
            {
                Damage = 350;
            }
                  
             else if (Weapon.Contains("msr"))
            {
                Damage = 350;
            }            
            else if (Weapon.Contains("44magnum"))
            {
                Damage = 150;
            }
            else if (Weapon.Contains ("deserteagle"))
           {
                Damage = 75;
            }
            else if (Weapon.Contains ("1887"))
             {
                Damage = 250;
              }
            else if (Weapon.Contains ("ksg"))
             {
              Damage = 100;
             }
            else if (Weapon.Contains("striker"))
            {
                Damage = 100;
            }
Because there are pellets and each pellet will do 100 damage I think.
oh really, thats why then when i lowered it to 15 it still took away 100-120 hp
What if i wanted to select from a team?
as doing this sorta crashed it


if (Attacker.Team == Teams.Axis)

if (Weapon.Contains("shield"))
{
Damage = 200;
}
else if (Weapon.Contains("knife"))
{
Damage = 200;
}
Code:
if( attacker.team == team.axis )
{
if( weapon == x )
{
  iDamage = y;
}
}
Also instead of doing a shit load of if statements I suggest doing a switch.
Like so: switch( sWeapon from onPlayerDamage ) case "iw5_derp_mp": Damage = 0; break; etc. it's much cleaner.