Didn't work with rocks totally. Will be an update of that plugin?
Build Blocker [Replaced]
Discussion in 'Plugin Support' started by Bombardir, Mar 8, 2015.
-
Hey the plugin dont do what he should do... everyone can build on rocks and and and... pls update the plugin and please make Blocks for Icebergs
ciao -
Please Uptade
-
-
New version!
Fixed all bugs.
Fixed building block in rock, on rock, sphere.
Add config var: block on iceberg.
Removed: Under Terrain.
Fixed foundation.steps name.
Need create new config!
Code:using UnityEngine; using System;namespace Oxide.Plugins { [Info("BuildBlocker", "Bombardir", "1.3.5", ResourceId = 834)] class BuildBlocker : RustPlugin { #region Config static bool OnIceberg = false; static bool OnRoad = false; static bool OnRiver = false; static bool OnRock = true; static bool InTunnel = true; static bool InRock = false; static bool InCave = true; static bool InWarehouse = true; static bool InMetalBuilding = true; static bool InHangar = true; static bool InTank = true; static bool InBase = true; static bool InStormDrain = false; static bool UnBridge = false; static bool UnRadio = false; static bool BlockStructuresHeight = false; static bool BlockDeployablesHeight = false; static int MaxHeight = 100; static bool BlockStructuresWater = false; static bool BlockDeployablesWater = false; static int MaxWater = -2; static int AuthLVL = 2; static string Msg = "Hey! You can't build here!"; static string MsgHeight = "You can't build here! (Height limit 100m)"; static string MsgWater = "You can't build here! (Water limit -2m)"; void LoadDefaultConfig() { } void CheckCfg<T>(string Key, ref T var) { if (Config[Key] is T) var = (T)Config[Key]; else Config[Key] = var; } void Init() { CheckCfg<bool>("Block On Iceberg", ref OnIceberg); CheckCfg<bool>("Block On Roads", ref OnRoad); CheckCfg<bool>("Block On Rivers", ref OnRiver); CheckCfg<bool>("Block On Rock", ref OnRock); CheckCfg<bool>("Block In Rock", ref InRock); CheckCfg<bool>("Block In Rock Cave", ref InCave); CheckCfg<bool>("Block In Storm Drain", ref InStormDrain); CheckCfg<bool>("Block In Tunnel", ref InTunnel); CheckCfg<bool>("Block In Base", ref InBase); CheckCfg<bool>("Block In Warehouse", ref InWarehouse); CheckCfg<bool>("Block In Metal Building", ref InMetalBuilding); CheckCfg<bool>("Block In Hangar", ref InHangar); CheckCfg<bool>("Block Under|On Metal Sphere", ref InTank); CheckCfg<bool>("Block Under|On Bridge", ref UnBridge); CheckCfg<bool>("Block Under|On Radar", ref UnRadio); CheckCfg<int>("Max Height Limit", ref MaxHeight); CheckCfg<bool>("Block Structures above the max height", ref BlockStructuresHeight); CheckCfg<bool>("Block Deployables above the max height", ref BlockDeployablesHeight); CheckCfg<int>("Max Under Water Height Limit", ref MaxWater); CheckCfg<bool>("Block Structures under water", ref BlockStructuresWater); CheckCfg<bool>("Block Deployables under water", ref BlockDeployablesWater); CheckCfg<string>("Block Water Message", ref MsgWater); CheckCfg<string>("Block Height Message", ref MsgHeight); CheckCfg<string>("Block Message", ref Msg); CheckCfg<int>("Ignore Auth Lvl", ref AuthLVL); SaveConfig(); } #endregion #region Logic void CheckBlock(BaseNetworkable StartBlock, BasePlayer sender, bool CheckHeight, bool CheckWater) { if (StartBlock && sender.net.connection.authLevel < AuthLVL && !StartBlock.isDestroyed) { Vector3 Pos = StartBlock.transform.position; if (StartBlock.name.Contains("foundation.steps")) Pos.y += 1.3f; if (CheckHeight || CheckWater) { float height = TerrainMeta.HeightMap.GetHeight(Pos); if (CheckHeight && Pos.y - height > MaxHeight) { sender.ChatMessage(MsgHeight); StartBlock.Kill(BaseNetworkable.DestroyMode.Gib); return; } else if (CheckWater && height < 0 && height < MaxWater && Pos.y < 2.8f ) { sender.ChatMessage(MsgWater); StartBlock.Kill(BaseNetworkable.DestroyMode.Gib); return; } } Pos.y += 200; RaycastHit[] hits = Physics.RaycastAll(Pos, Vector3.down, 202.8f); Pos.y -= 200; for (int i = 0; i < hits.Length; i++) { RaycastHit hit = hits[i]; if (hit.collider) { string ColName = hit.collider.name; if (InBase && ColName.StartsWith("base", StringComparison.CurrentCultureIgnoreCase) || InMetalBuilding && ColName == "Metal_building_COL" || UnBridge && ColName == "Bridge_top" || UnRadio && ColName.StartsWith("dish") || InWarehouse && ColName.StartsWith("Warehouse") || InHangar && ColName.StartsWith("Hangar") || OnRiver && ColName == "rivers" || InTunnel && ColName.Contains("unnel") || OnIceberg && ColName == "iceberg_COL" || OnRoad && ColName.EndsWith("road", StringComparison.CurrentCultureIgnoreCase) || InStormDrain && ColName.StartsWith("Storm_drain", StringComparison.CurrentCultureIgnoreCase) || InTank && ColName.Contains("sphere") || (ColName.StartsWith("rock", StringComparison.CurrentCultureIgnoreCase) || ColName.StartsWith("cliff", StringComparison.CurrentCultureIgnoreCase) || ColName == "Mesh") && (hit.point.y < Pos.y ? OnRock : hit.collider.bounds.Contains(Pos) ? InRock : InCave)) { sender.ChatMessage(Msg); StartBlock.Kill(BaseNetworkable.DestroyMode.Gib); break; } } } } } #endregion #region Hooks void OnEntityBuilt(Planner plan, GameObject obj) => CheckBlock(obj.GetComponent<BaseNetworkable>(), plan.ownerPlayer, BlockStructuresHeight, BlockStructuresWater); void OnItemDeployed(Deployer deployer, BaseEntity deployedentity) { if (!(deployedentity is BaseLock)) CheckBlock((BaseNetworkable) deployedentity, deployer.ownerPlayer, BlockDeployablesHeight, BlockDeployablesWater); } #endregion } }
Last edited by a moderator: Sep 19, 2015 -
sorry man , but i am not sure i understand what you want me to do . do i just put the new config in place of the old one of keep and make a second one do i need a new json :S
-
Just search in the plugin for Chat Handle and change Russian to English. Thanks man great work
Last edited by a moderator: Oct 13, 2015 -
Thanks for your great job, man =)
-
Still having Rock Houses with this. Hope to see a future update sometime.
-
Would love a fix also to stop building in rocks
Would prefer if a player went inside (not on, or in a cave) a rock that they be teleported out. -
Can someone please update this? Inside of rocks and iceberg bases suck..
-
@Bombardir
I got told by some players of my server that they get the message
Hey! You can't build here!
Although they are just trying to rebuild a hole in their high external stone wall.
There is nothing from the env that could trigger BuildBlocker like rocks etc.
Config we run
Code:"Block In Base": true, "Block In Hangar": true, "Block In Metal Building": true, "Block In Rock": true, "Block In Rock Cave": true, "Block In Storm Drain": false, "Block In Tunnel": true, "Block In Warehouse": true, "Block Message": "Hey! You can't build here!", "Block On Rivers": false, "Block On Roads": true, "Block On Rock": false, "Block Structures above the max height": false, "Block Structures under water": true, "Block Under Terrain": false, "Block Under|On Bridge": true, "Block Under|On Metal Sphere": true, "Block Under|On Radar": true,
-
-
-
-
-
-
hmm we need a new update for this, need to block, rock houses