Solved Repair all structures

Discussion in 'Plugin Requests' started by Andie, Jun 16, 2015.

  1. Is there a plugin that repairs all structures on the server? instead of my going around repairing everyone one by one?
     
  2. Something like this would do it:
    Code:
    [ChatCommand("repair")]
            void chatCommand_repair(BasePlayer player, string command, string[] args)
            {
                if (player.net.connection.authLevel == 1 || player.net.connection.authLevel == 2 )
                {
                    List<BuildingBlock> allBlocks = Component.FindObjectsOfType<BuildingBlock>().ToList();
                    foreach(BuildingBlock block in allBlocks)
                    {
                        block.health = block.MaxHealth();
                    }
                }
            }
     
  3. [Oxide] 9:58 PM [Error] repair plugin failed to compile!
    [Oxide] 9:58 PM [Error] repair.cs(2,8): error CS1525: Unexpected symbol `void'
     
  4. It was example code, not a fully made plugin.
     
  5. oh how do i put it into my server? as a plugin?
     
  6. I can make it a plugin and upload it if you want, or you can use this: (Do remove this Wulf if this is not allowed)
     
  7. Thanks man worked perfectly ! :) <3
     
  8. Wulf

    Wulf Community Admin

    Generally they should go through the approval process, but posting them for testing is fine.
     
  9. Post as a plugin I think it would get some downloads lol
     
  10. Will you be making this a plugin? I ask because if not, I can make it and attribute it to you and manage it. I was actually looking into making a plugin that will grab all connected items to a building, list the cost to upgrade it all to X type, then allow the player to upgrade an entire building all at once and remove the items from their inventory. Not sure if I'd put the 2 features together or not.

    Let me know :)
     
  11. Make it please lol I NEED THIS!
     
  12. Still needed to repair current ones
     
  13. How do you get this to work? The txt he posted? I would like it for my server
     
  14. Create a file called RepairAll save it as a .cs file and put it into your plugins folder.
    Note: Naming it like above is important since the class is called RepairAll but you can change that in the code and rename it like you would want your file named

    Then run /repair as chat command
     
  15. Awesome got it to work, but it doesnt repair high stone gates, any reason?
     
  16. The plugin goes through all Buildings of the type BuildingBlock. A High external wall or gate is as far as I know not of that type.
     
  17. Everything you can build with the building plan should be affected by this plugin
     
  18. Exactly. And a High external wall is not of the type BuildingBlock. Its not built by the Building Plan.
     
  19. @Wulf
    The question got answered
    Solved.