Solved Rocket range for explosion

Discussion in 'Plugin Requests' started by Artasan, Mar 25, 2016.

  1. it is possible to make plugin, which lets to reconfigure rocket explode ranges? range where rocket explodes by itself, if no obstacles found on the rocket's fly trajectory.
     
  2. I've never found a way to do this, but you could maybe find out the (X,Y,Z) of where the player was looking when he shot, then create a timer for (x) seconds then when that timer is up create a rocket that flys in the previous (X,Y,Z) stored.
     
  3. @DylanSMR, You can do it by using the TimedExplosive component of a rocket and changing 'timerAmountMin' and 'timerAmountMax'
     
  4. yes, i suspected what it's time param qustion not a range.
     
  5. Using this should do what you want, I use these in a few of my mods to extend the default explode time
    Code:
    void OnRocketLaunched(BasePlayer player, BaseEntity entity)
            {
                var explosive = entity as TimedExplosive;
                if (explosive)
                {
    // From the looks of the TimedExplosive class it seems like a random time (seconds) is generated using the min and max values
                    explosive.timerAmountMin = 5f;
                    explosive.timerAmountMax = 10f;
                }
    }
     
  6. oh, almost done plugin) thank you.
    i am not so good at coding, but ill try.
     
  7. so where would that code go into?