Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
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 309 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined Offline
    undefined Offline
    Beatology
    wrote on Feb 8, 2020, 10:52 AM last edited by Mr. Android Apr 2, 2020, 12:44 AM
    #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 ❤

    undefined 1 Reply Last reply Feb 8, 2020, 4:15 PM
    0
    • undefined Offline
      undefined Offline
      Ox_
      wrote on Feb 8, 2020, 12:00 PM 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?

      undefined 1 Reply Last reply Feb 8, 2020, 1:05 PM
      0
      • undefined Offline
        undefined Offline
        frosty
        replied to Ox_ on Feb 8, 2020, 1:05 PM 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
        • undefined Offline
          undefined Offline
          Xerxes Plutonium Staff
          replied to Beatology on Feb 8, 2020, 4:15 PM 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

          2/4

          Feb 8, 2020, 12:00 PM

          • Login

          • Don't have an account? Register

          • Login or register to search.
          1 / 1
          • First post
            2/4
            Last post
          0
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Donate