Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. [Support] Disable Function (Damage) of Grenades and Tacticals

[Support] Disable Function (Damage) of Grenades and Tacticals

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
4 Posts 4 Posters 723 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Beatologyundefined Offline
    Beatologyundefined Offline
    Beatology
    wrote on last edited by Mr. Android
    #1

    Hello Guys!

    I´m trying to disable the Damage of Schockcharges, Semtex, Flashbangs ... but its not working with my corrent Script, can someone help!?

    Extract from the script: (onPlayerDamage)

        if ( StrTok(sWeapon, "_")[0] == "frag_grenade" )
        {
            iDamage = 0;
        }
       
        if ( StrTok(sWeapon, "_")[0] == "concussion_grenade_mp" )
        {
            iDamage = 0;
        }
       
        if ( StrTok(sWeapon, "_")[0] == "sticky_grenade_mp" )
        {
            iDamage = 0;
        }
       
        if ( StrTok(sWeapon, "_")[0] == "willy_pete_mp" )
        {
            iDamage = 0;
        }
       
        if ( StrTok(sWeapon, "_")[0] == "hatchet_mp" )
        {
            iDamage = 100;
        }
       
        if ( StrTok(sWeapon, "_")[0] == "sensor_grenade_mp" )
        {
            iDamage = 0;
        }
       
        if ( StrTok(sWeapon, "_")[0] == "bouncingbetty_mp" )
        {
            iDamage = 0;
        }
       
        if ( StrTok(sWeapon, "_")[0] == "emp_grenade_mp" )
        {
            iDamage = 0;
        }
       
        if ( StrTok(sWeapon, "_")[0] == "satchel_charge_mp" )
        {
            iDamage = 0;
        }
       
        if ( StrTok(sWeapon, "_")[0] == "proximity_grenade_mp" )
        {
            iDamage = 0;
        }
       
        if ( StrTok(sWeapon, "_")[0] == "claymore_mp" )
        {
            iDamage = 0;
        }
       
        if ( StrTok(sWeapon, "_")[0] == "pda_hack_mp" )
        {
            iDamage = 0;
        }
       
        if ( StrTok(sWeapon, "_")[0] == "trophy_system_mp" )
        {
            iDamage = 0;
        }
       
        if ( StrTok(sWeapon, "_")[0] == "flash_grenade_mp" )
        {
            iDamage = 0;
    

    THANKS ❤

    Xerxesundefined 1 Reply Last reply
    0
    • Ox_undefined Offline
      Ox_undefined Offline
      Ox_
      wrote on last edited by
      #2

      What you're actually interested in, is the smeansofdeath paramater.
      With it, you match against damage types.
      Here are a few ones that should get you pretty far.
      MOD_GRENADE_SPLASH
      MOD_IMPACT
      MOD_GAS
      MOD_EXPLOSIVE
      You can find more by e.g. just iprintlning the parameter and then testing all kinds of damage.

      onplayerdamage(einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime)
      {
      	if(smeansofdeath == "MOD_GRENADE_SPLASH" || smeansofdeath == "MOD_IMPACT" || smeansofdeath == "MOD_GAS" || smeansofdeath == "MOD_EXPLOSIVE")
      		idamage = 0;
      	return idamage;
      }
      

      But really, this is probably for trickshotting? Maybe just allow damage from the weapon class sniper, and ignore everything else?

      frostyundefined 1 Reply Last reply
      0
      • Ox_undefined Ox_

        What you're actually interested in, is the smeansofdeath paramater.
        With it, you match against damage types.
        Here are a few ones that should get you pretty far.
        MOD_GRENADE_SPLASH
        MOD_IMPACT
        MOD_GAS
        MOD_EXPLOSIVE
        You can find more by e.g. just iprintlning the parameter and then testing all kinds of damage.

        onplayerdamage(einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime)
        {
        	if(smeansofdeath == "MOD_GRENADE_SPLASH" || smeansofdeath == "MOD_IMPACT" || smeansofdeath == "MOD_GAS" || smeansofdeath == "MOD_EXPLOSIVE")
        		idamage = 0;
        	return idamage;
        }
        

        But really, this is probably for trickshotting? Maybe just allow damage from the weapon class sniper, and ignore everything else?

        frostyundefined Offline
        frostyundefined Offline
        frosty
        wrote on last edited by
        #3

        Ox_ said in Disable Function (Damage) of Grenades and Tacticals:

        But really, this is probably for trickshotting? Maybe just allow damage from the weapon class sniper, and ignore everything else?

        How would I do this?

        1 Reply Last reply
        0
        • Beatologyundefined Beatology

          Hello Guys!

          I´m trying to disable the Damage of Schockcharges, Semtex, Flashbangs ... but its not working with my corrent Script, can someone help!?

          Extract from the script: (onPlayerDamage)

              if ( StrTok(sWeapon, "_")[0] == "frag_grenade" )
              {
                  iDamage = 0;
              }
             
              if ( StrTok(sWeapon, "_")[0] == "concussion_grenade_mp" )
              {
                  iDamage = 0;
              }
             
              if ( StrTok(sWeapon, "_")[0] == "sticky_grenade_mp" )
              {
                  iDamage = 0;
              }
             
              if ( StrTok(sWeapon, "_")[0] == "willy_pete_mp" )
              {
                  iDamage = 0;
              }
             
              if ( StrTok(sWeapon, "_")[0] == "hatchet_mp" )
              {
                  iDamage = 100;
              }
             
              if ( StrTok(sWeapon, "_")[0] == "sensor_grenade_mp" )
              {
                  iDamage = 0;
              }
             
              if ( StrTok(sWeapon, "_")[0] == "bouncingbetty_mp" )
              {
                  iDamage = 0;
              }
             
              if ( StrTok(sWeapon, "_")[0] == "emp_grenade_mp" )
              {
                  iDamage = 0;
              }
             
              if ( StrTok(sWeapon, "_")[0] == "satchel_charge_mp" )
              {
                  iDamage = 0;
              }
             
              if ( StrTok(sWeapon, "_")[0] == "proximity_grenade_mp" )
              {
                  iDamage = 0;
              }
             
              if ( StrTok(sWeapon, "_")[0] == "claymore_mp" )
              {
                  iDamage = 0;
              }
             
              if ( StrTok(sWeapon, "_")[0] == "pda_hack_mp" )
              {
                  iDamage = 0;
              }
             
              if ( StrTok(sWeapon, "_")[0] == "trophy_system_mp" )
              {
                  iDamage = 0;
              }
             
              if ( StrTok(sWeapon, "_")[0] == "flash_grenade_mp" )
              {
                  iDamage = 0;
          

          THANKS ❤

          Xerxesundefined Offline
          Xerxesundefined Offline
          Xerxes
          Plutonium Staff
          wrote on last edited by
          #4

          Beatology

          You are splitting the weapon string by every _ take the first element and then compare it against a string that has an _, that is why your code is not and will never work.

          1 Reply Last reply
          0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Recent
          • Tags
          • Popular
          • Users
          • Groups