R-Remover-Tool

Building and entity removal tool

Total Downloads: 63,252 - First Release: Apr 3, 2015 - Last Update: Feb 7, 2018

5/5, 105 likes
  1. You mean on loading in the plugin??
    Could you describe it a bit more deeper? Would maybe explain some other things people asking me on BetterLoot thread.
     
  2. Thanks for this awsome plugin!
    But was it that hard to make % of initial cost work with deployable?

    Code:
    ----->static Dictionary<string, string> PrefabNameToDeployableShort = new Dictionary<string, string>();
            void InitializeItems()
            {
                foreach (var item in ItemManager.GetItemDefinitions())
                {
                    if (!ItemNameToItemID.ContainsKey(item.displayName.english.ToLower())) ItemNameToItemID.Add(item.displayName.english.ToLower(), item.itemid);                var itemdeployable = item?.GetComponent<ItemModDeployable>();
                    if (itemdeployable == null) continue;                if (!PrefabNameToDeployable.ContainsKey(itemdeployable.entityPrefab.resourcePath)) PrefabNameToDeployable.Add(itemdeployable.entityPrefab.resourcePath, item.displayName.english);
                    ----->if(!PrefabNameToDeployableShort.ContainsKey(itemdeployable.entityPrefab.resourcePath)) PrefabNameToDeployableShort.Add(itemdeployable.entityPrefab.resourcePath, item.shortname);
                }
            }
    and
    Code:
     static Dictionary<string, object> GetRefund(BaseEntity TargetEntity)
            {
                var refund = new Dictionary<string, object>();
                var buildingblock = TargetEntity.GetComponent<BuildingBlock>();
                if (buildingblock != null)
                {
                            ...
                }
                else
                {
                    var Name = GetName(TargetEntity.PrefabName);
                    ----->if (PrefabNameToDeployableShort.ContainsKey(TargetEntity.PrefabName))
                    ----->{
                    ----->    var shortname = PrefabNameToDeployableShort[TargetEntity.PrefabName];
                    ----->    var def = ItemManager.FindItemDefinition(shortname);
                    ----->    if(def != null)
                    ----->    {
                    ----->        foreach (var item in def.Blueprint.ingredients)
                    ----->        {
                     ---->           refund.Add(item.itemDef.displayName.english.ToLower(), (int)item.amount/2);
                    ----->          //Interface.Oxide.LogWarning($"{item.itemDef.shortname} - x{item.amount}");
                    ----->        }
                    ----->    }
                    ----->}
                }
                //if (Refund.ContainsKey(Name)) refund = Refund[Name] as Dictionary<string, object>;
                return refund;
            }
     
  3. Would I require the building owners mod if I just wanted to let anyone with cupboard access remove items?
     
  4. hi, I have an issue that it won't let players even when they have the required resources on them to remove sheet metal walls. It justs says that they don't have the required resources to remove it.
     
  5. Could we get the Flame Thrower and Vending Machine added to the config, please?
     
  6. ^^ and Tuna lights!
     
  7. Flame Turret, FTFY.
     
  8. Here's a fix for Vending Machines. I believe it will work for the Flame Thrower Turret and Tuna Lights, but haven't' tested it yet (See update below). Add the following lines to your RemoverTool.json config file. I put my in alphabetical order after "U Shaped Stairs" and"Two Sided Town Sign Post" but I don't think you have to. (I included the item above for reference. Don't add it twice.)

    Under "Remove - Normal - Allowed Entities" (about line 158)
    Code:
     "U Shaped Stairs": true,
    "Vending Machine": true,
    Under "Remove - Normal - Refund"(about line 408 in mine, around 762 in the default config)
    Code:
    "Two Sided Town Sign Post": {
          "two sided town sign post": 1
        },
        "Vending Machine": {
          "vending machine": 1
        },
    Update: I tested both the Flame Turret and the Tuna Can Lamp and they work also using those names. I'm not sure if it's case sensitive - I just followed the format of the other entries. Again, I put them in both sections.

    Quick note: I have deleted the "Remove - Normal - Price" section making all remove functions free on my server. You'll have to add something in that section like what's below if you haven't, otherwise it'll be free.
    Code:
    "Vending Machine": {
          "metal fragments": 10,
          "gears": 1
        },
     
    Last edited by a moderator: Feb 11, 2017
  9. Hi!

    I'm having problems removing sheet metal walls, frames, etc from my server.

    Here's my cfg for the remover: https://api.myjson.com/bins/qv9e1

    What am I doing wrong?
     
  10. Try deleting your config so it creates a new one.
     
  11. Tried this now, deleted it and just had the regular one and deleted and tried the one I posted here. None worked, got "You don't have enough resources." even tho I had over 3k metal frags and wood in my inventory.
     
  12. I am the owner of a rust server and everytime I try to do /remove all, I get "Couldn't use the RemoverTool: No valid entity targeted, or entity is too far away."
     
  13. Hey, been using this plugin for a while. I currently have it configured to only allow Entity Owners to remove items (config below), however the issue with this is it allows them to /remove even if they don't have tool cupboard access. However, when i set Tool Cupboard to True, it kinda overrides the Entity Owner true and lets anyone with TC access to /remove. Any fix for this?

    Code:
      "Remove - Normal - Use Building Owners (You will need Building Owners plugin)": false,
      "Remove - Normal - Use Entity Owners": true,
      "Remove - Normal - Use Friends (Friends)": false,
      "Remove - Normal - Use Friends (RustIO)": false,
      "Remove - Normal - Use Tool Cupboards (strongly unrecommended)": false,
     
  14. The way the plug-in is written, there doesn't seem to be an easy, config-based fix. Under the HasAccess function (around line 1120) there are a series of checks. In order these are (btw, each one includes additional checks for Friends access):
    • Are we using EntityOwners? If the player is the Entity owner then stop checking and remove.
    • Are we using BuildingOwners? If the player is the Building owner then stop checking and remove.
    • Are we using Tool Cupboards? If the player is authorized on all TC's then stop checking and remove.
    • If everything else fails: don't remove.
    What this means is, once it gets an okay to remove, it stops checking for other conditions. You only need to meet one of the conditions set.

    If you wanted to change the code, there is a not-so-easy fix. The only key is you'll have to remember to make the change every time the plug-in is updated in order keep it in effect. What we'll do is add an additional step to the Are we using EntityOwners check. This will look to see if the player has total TC access (that is, if the player is authorized on every TC that covers that block).

    Code:
    In version 4.0.11, around line 1122
    REPLACE:
    if (RemoveWithEntityOwners)
    WITH:
    if (RemoveWithEntityOwners &&  hasTotalAccess(player))
    
    Now the player not only has to be the person who built the block, but has to be authorized on every TC that covers the block.

    The potential downside is that if a person's TC is compromised, or someone else builds a TC that overlaps a block (say, just ouside the edge of the base) the builder will not be able to /remove the block.
     
  15. Would it be possible to enable ent.kill for non admins? (own entities only)
     
  16. Hey! Thank you so much for the in depth info, I changed the plugin as you said and it works perfectly! Thanks a ton <3

     
  17. After this update its making people pay to remove items regardless of how the config is setup. Any ideas?
     
    Last edited by a moderator: Feb 16, 2017
  18. Glad to help. :)

    At first I thought you meant the change I posted, then it occurred to me that (I hope) you meant the Rust update.
    Not sure how that could happen. AFAIK, the way to prevent people from having to pay is to remove the "Remove - Normal - Price": section from the config (starting around line 178). On my server, I've pulled the whole thing, but I guess you could remove the price for select items. How were you preventing people from being charged? If it was buy pulling the prices from the config, how does the plug-in know what to charge? Are they getting a message even if they have the items in their inventory?

    You might check your config to make sure it wasn't overwritten with the default. Notifier does this to me all the time when I forget a comma.
     
  19. Thanks bro, i removed those lines of code and it worked. The config wasn't reset. Just for some reason even with pay set to False it was as if it was set to True. Anywho, all good now. just removed the code and perfect :)

    Thanks again!
     
  20. getting this error
    Code:
    NullReferenceException: Object reference not set to an instance of an object
    at Oxide.Plugins.RemoverTool.GetRefund (.BaseEntity TargetEntity) [0x00000] in <filename unknown>:0 
    at Oxide.Plugins.RemoverTool.GUIRefundUpdate (.BasePlayer player, Boolean useRefund, .BaseEntity TargetEntity) [0x00000] in <filename uknown>:0 
    at Oxide.Plugins.RemoverTool+ToolRemover.RemoveUpdate () [0x00000] in <filename unknown>:0