Damage Mod : Deployables

Prevents / Allows Damage to Numerous Deployables

Total Downloads: 1,017 - First Release: Jul 17, 2015 - Last Update: May 20, 2017

5/5, 7 likes
  1. Hello, there is a problem while compiling the plugin

    "[Oxide] 22:14 [Error] Error while compiling: DMDeployables.cs(70,17): error CS0150: A constant value is expected"

    Is there an issue for this problem?
     
  2. Colon Blow updated Damage Mod : Deployables with a new update entry:

    1.1.7




    Plus I am running thru all the new deployables so I can add them all in. That should be added in a few days.
     
  3. Is the vending machine apart of this plugin? Ive been looking for a plugin to modify the damage vending machines take to hopefully increase people making shops
     
  4. Colon Blow updated Damage Mod : Deployables with a new update entry:

    1.1.8

     
  5. Colon Blow updated Damage Mod : Deployables with a new update entry:

    1.1.9

     
  6. You forgot to comment out line 152 :)
     
  7. Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;namespace Oxide.Plugins
    {
        [Info("DMDeployables", "ColonBlow", "1.1.9", ResourceId = 1240)]
        class DMDeployables : RustPlugin
        {
            private Dictionary<string, bool> deployables = new Dictionary<string, bool>();
            private Dictionary<string, string> prefabs = new Dictionary<string, string>();
            private bool init = false;        void OnServerInitialized() => LoadVariables();        void Unload()
            {
                deployables.Clear();
                prefabs.Clear();
            }        object OnEntityTakeDamage(BaseCombatEntity entity, HitInfo hitInfo)
            {
                if (!init || entity == null || hitInfo == null)
                    return null;            var kvp = prefabs.FirstOrDefault(x => x.Key == entity.PrefabName);            return !string.IsNullOrEmpty(kvp.Value) && deployables.ContainsKey(kvp.Value) && deployables[kvp.Value] ? (object)false : null;
            }        #region Config
            private bool Changed;        void LoadVariables()
            {
                foreach (var itemDef in ItemManager.GetItemDefinitions().ToList())
                {
                    var mod = itemDef.GetComponent<ItemModDeployable>();                if (mod != null)
                    {
                        deployables[itemDef.displayName.translated] = Convert.ToBoolean(GetConfig("Deployables", string.Format("Block {0}", itemDef.displayName.translated), false));
                        prefabs[mod.entityPrefab.resourcePath] = itemDef.displayName.translated;
                    }
                }            init = true;            if (Changed)
                {
                    SaveConfig();
                    Changed = false;
                }
            }        protected override void LoadDefaultConfig()
            {
                PrintWarning("Creating a new configuration file");
                Config.Clear();
                LoadVariables();
            }        object GetConfig(string menu, string datavalue, object defaultValue)
            {
                var data = Config[menu] as Dictionary<string, object>;
                if (data == null)
                {
                    data = new Dictionary<string, object>();
                    Config[menu] = data;
                    Changed = true;
                }
                object value;
                if (!data.TryGetValue(datavalue, out value))
                {
                    value = defaultValue;
                    data[datavalue] = value;
                    Changed = true;
                }
                return value;
            }
            #endregion
        }
    }
    
    A little contribution so you don't have to add new deployable's to the plugin.
     
    Last edited by a moderator: May 14, 2017
  8. Colon Blow updated Damage Mod : Deployables with a new update entry:

    1.1.10


    [DOUBLEPOST=1494720848][/DOUBLEPOST]
    Very nice addition, I was eventually working in that direction. But that is spot on..thanks :)
    Ill work that in soon.
     
  9. Sure, it might need some tweaking. I haven't tested it.
     
  10. yes, it does seem to need a few adjustments to work. But, its a good start for sure. :)
     
  11. yup, the code you have works fine now. you faster than me :) you rock.
    didn't see you had changed it recently.
     
  12. Colon Blow updated Damage Mod : Deployables with a new update entry:

    1.1.11

     
  13. Hello

    The target can pick up any! Fix Please
    Code:
    "Block Reactive Target": true,
     

    Attached Files:

  14. Currently the plugin only blocks damages. it does not prevent pickup of items.

    But since this plugin is meant to help prevent other players from messing with your deployables. I see where it would be a good addition.

    I could work on adding : If set to true, it would only allow owner to pickup ?
     
  15. Yes. Only the owner can raise. This will be a good addition! Thank you!
     
  16. if i set it to protect the large box how can i make it so the codelock has to be destroyed to enter it also how would i add pumpjacks into this
     
    Last edited by a moderator: Jun 27, 2017
  17. Hello! First of all, does this plugin still work? Also, since a lot of people are now destroying the tool cupboards to basically raid and cause a player's base to decay, would this plugin allow me to make the cupboards invincible? Thank you.
     
  18. why the Helicopter can not damage the house???