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?

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
-
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. -
-
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
-
Colon Blow updated Damage Mod : Deployables with a new update entry:
1.1.8
-
Colon Blow updated Damage Mod : Deployables with a new update entry:
1.1.9
-
You forgot to comment out line 152
-
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 } }
Last edited by a moderator: May 14, 2017 -
Colon Blow updated Damage Mod : Deployables with a new update entry:
1.1.10
[DOUBLEPOST=1494720848][/DOUBLEPOST]
Ill work that in soon. -
Sure, it might need some tweaking. I haven't tested it.
-
-
you rock.
didn't see you had changed it recently. -
Colon Blow updated Damage Mod : Deployables with a new update entry:
1.1.11
-
Hello
The target can pick up any! Fix Please
Code:"Block Reactive Target": true,
Attached Files:
-
-
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 ? -
Yes. Only the owner can raise. This will be a good addition! Thank you!
-
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 -
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.
-
why the Helicopter can not damage the house???