public void OnEntityDeployed(Fougerite.Player pl, Fougerite.Entity e, Fougerite.Player actualplacer) { if (e.Name.ToLower().Contains("camp") || e.Name.ToLower().Contains("furnace") || e.Name.ToLower().Contains("storage") || e.Name.ToLower().Contains("box") || e.Name.ToLower().Contains("bench") || e.Name.ToLower().Contains("sleeping") || e.Name.ToLower().Contains("stash") || e.Name.ToLower().Contains("ceiling") || e.Name.ToLower().Contains("foundation")) { var location = new Vector3(e.Location.x, e.Location.y, e.Location.z); if (e.Name.ToLower().Contains("foundation")) { location = new Vector3(e.Location.x, e.Location.y + 6f, e.Location.z); } else if (e.Name.ToLower().Contains("bench")) { location = new Vector3(e.Location.x, e.Location.y + 1f, e.Location.z); } if (SearchForRock(location)) { actualplacer.MessageFrom(Name + Version, red + "Not allowed to build so close/inside a Rock " + white + " Your " + e.Name + " has been destroyed"); if (!actualplacer.Admin) { e.Destroy(); } else { actualplacer.MessageFrom(Name + Version, green + "Admin Bypass "); } } } }
public void OnEntityDeployedWithPlacer(Fougerite.Player pl, Fougerite.Entity e, Fougerite.Player actualplacer) { if (IsShopAround(e.Location)) { actualplacer.MessageFrom(Name, red + "You cant place Storages closed to the Shop!!"); e.Destroy(); } }
public void OnEntityDeployed(Fougerite.Player pl, Fougerite.Entity e, Fougerite.Player actualplacer) { if (e.Name.ToLower().Contains("Wood shelter")) { e.Destroy(); { pl.MessageFrom("ShelterBlocker", "You cannot place shelters on this server"); pl.Notice("✘", "Shelters are forbidden"); return; } } }
public void CallBack(TimedEvent e) { var dict = e.Args; e.Kill(); Fougerite.Player pl = (Fougerite.Player)dict["player"]; Fougerite.Entity ent = (Fougerite.Entity)dict["entity"]; try { ent.Destroy(); } catch (Exception exc) { Logger.Log(Name + " ERROR: Failed to destroy " + ent.Name + " at position " + ent.Location.ToString()); Logger.Log(Name + exc.ToString()); } if (pl.IsAlive && !pl.IsDisconnecting) { pl.Message("Your " + green + ent.Name + white + " has been removed for exceeding the maximum time allowed"); } }
void EntityDeployed(Fougerite.Player Player, Fougerite.Entity Entity) { if (Config.GetSetting("Settings", "enabled").ToLower() == "true" && Entity != null) { if (Entity.Name == "WoodFoundation" || Entity.Name == "MetalFoundation" || Entity.Name == "WoodRamp" || Entity.Name == "MetalRamp") { var name = Entity.Name; bool GiveBack = Config.GetSetting("Settings", "giveback").ToLower() == "true"; var two = Util.GetUtil().CreateVector(Entity.X, Entity.Y, Entity.Z); foreach (Entity ent in World.GetWorld().Entities) { var one = Util.GetUtil().CreateVector(ent.X, ent.Y, ent.Z); var dist = Util.GetUtil().GetVectorsDistance(one, two); if (ent.Name == "WoodRamp" || ent.Name == "MetalRamp") { if (Entity != ent && Entity.InstanceID != ent.InstanceID && dist == 0) { if (GiveBack && Player != null) { if (name == "WoodRamp") { name = "Wood Ramp"; } else if (name == "MetalRamp") { name = "Metal Ramp"; } Player.Inventory.AddItem(name, 1); } Entity.Destroy(); return; } } else if (ent.Name != "WoodRamp" && ent.Name != "MetalRamp" && ent.Name != "WoodFoundation" && ent.Name != "WoodDoorFrame" && ent.Name != "WoodWall" && ent.Name != "WoodPillar" && ent.Name != "WoodCeiling" && ent.Name != "MetalDoor" && ent.Name != "WoodStairs" && ent.Name != "WoodWindowFrame" && ent.Name != "MetalFoundation" && ent.Name != "MetalDoorFrame" && ent.Name != "MetalWall" && ent.Name != "MetalPillar" && ent.Name != "MetalCeiling" && ent.Name != "MetalStairs" && ent.Name != "MetalWindowFrame" && ent.Name != "Wood_Shelter" && ent.Name != "Barricade_Fence_Deployable" && ent.Name != "Wood Box" && ent.Name != "Metal Bars Window" && ent.Name != "CampFire" && ent.Name != "Wood Spike Wall" && ent.Name != "Large Wood Spike Wall") { if (Entity != ent && Entity.InstanceID != ent.InstanceID && dist <= 2.5) { if (Player != null) { Player.Notice("Ya can't place chest under foundation bitch!"); if (GiveBack) { if (name == "WoodFoundation") { name = "Wood Foundation"; } else if (name == "MetalFoundation") { name = "Metal Foundation"; } Player.Inventory.AddItem(name, 1); } } Entity.Destroy(); return; } } } } } }
public void EntityDeployed(Fougerite.Player Player, Fougerite.Entity Entity, Fougerite.Player actualplacer) { try { if (Entity != null) { if (Entity.Name.Contains("Foundation") || Entity.Name.Contains("Ramp") || Entity.Name.Contains("Pillar") || Entity.Name == "WoodDoor" || Entity.Name == "MetalDoor") { string name = Entity.Name; var location = Entity.Location; if (Ramp && name.Contains("Ramp")) { RaycastHit cachedRaycast; bool cachedBoolean; Facepunch.MeshBatch.MeshBatchInstance cachedhitInstance; if (Facepunch.MeshBatch.MeshBatchPhysics.Raycast(location + new Vector3(0f, 0.1f, 0f), Vector3Down, out cachedRaycast, out cachedBoolean, out cachedhitInstance)) { if (cachedhitInstance != null) { var cachedComponent = cachedhitInstance.physicalColliderReferenceOnly.GetComponent <StructureComponent>(); if (cachedComponent.type == StructureComponent.StructureComponentType.Foundation || cachedComponent.type == StructureComponent.StructureComponentType.Ceiling) { var weight = cachedComponent._master._weightOnMe; int ramps = 0; if (weight != null && weight.ContainsKey(cachedComponent)) { ramps += weight[cachedComponent].Count(structure => structure.type == StructureComponent.StructureComponentType.Ramp); } if (ramps > 1) { Entity.Destroy(); if (GiveBack && actualplacer.IsOnline) { switch (name) { case "WoodFoundation": name = "Wood Foundation"; break; case "MetalFoundation": name = "Metal Foundation"; break; case "WoodRamp": name = "Wood Ramp"; break; case "MetalRamp": name = "Metal Ramp"; break; case "WoodPillar": name = "Wood Pillar"; break; case "MetalPillar": name = "Metal Pillar"; break; } actualplacer.Inventory.AddItem(name, 1); } return; } } } } } if (Struct) { bool isdoor = false; float d = 4.5f; if (name.Contains("Pillar")) { d = 0.40f; } else if (name.Contains("Door")) { isdoor = true; d = 0.40f; } else if (name.ToLower().Contains("smallstash")) { d = 0.40f; } else if (name.Contains("Foundation")) { d = 4.5f; } else if (name.Contains("Ramp")) { if (!CheckForRampLoot) { return; } d = 3.5f; } var x = Physics.OverlapSphere(location, d); if ( x.Any( l => l.name.ToLower().Contains("woodbox") || l.name.ToLower().Contains("smallstash") || (l.name.ToLower().Contains("door") && !isdoor))) { Entity.Destroy(); if (actualplacer.IsOnline && GiveBack) { switch (name) { case "WoodFoundation": name = "Wood Foundation"; break; case "MetalFoundation": name = "Metal Foundation"; break; case "WoodRamp": name = "Wood Ramp"; break; case "MetalRamp": name = "Metal Ramp"; break; case "WoodPillar": name = "Wood Pillar"; break; case "MetalPillar": name = "Metal Pillar"; break; case "WoodDoor": name = "Wood Door"; break; case "MetalDoor": name = "Metal Door"; break; } actualplacer.Inventory.AddItem(name, 1); } return; } } if (BarricadePillar) { if (name.Contains("Pillar")) { if (Physics.OverlapSphere(location, 0.34f).Where(collider => collider.GetComponent <DeployableObject>() != null).Any(collider => collider.GetComponent <DeployableObject>().name.Contains("Barricade_Fence"))) { actualplacer.Message("Pillar Barricade glitching no esta permitido!"); Entity.Destroy(); if (actualplacer.IsOnline && GiveBack) { switch (name) { case "WoodPillar": name = "Wood Pillar"; break; case "MetalPillar": name = "Metal Pillar"; break; } actualplacer.Inventory.AddItem(name, 1); } } } } } } } catch (Exception ex) { Logger.LogDebug("[GlitchFix] Some error showed up. Report this. " + ex); } }
public void OnEntityDeployed(Fougerite.Player pl, Fougerite.Entity e, Fougerite.Player actualplacer) { if (e.Name == "Wood_Shelter") { if (BlockShelterCloseToDoor) { foreach (Fougerite.Entity xx in Util.GetUtil().FindEntitiesAround(e.Location, 5f)) { if (xx.Name == "WoodDoorFrame") { e.Destroy(); pl.MessageFrom(sys, orange + "You cannot place Wood Shelter so close to DoorWays"); } else if (xx.Name == "MetalDoorFrame") { e.Destroy(); pl.MessageFrom(sys, orange + "You cannot place Wood Shelter so close to DoorWays"); } } } } else if (e.Name.ToLower().Contains("spike")) { if (BlockSpikeCloseToDoor) { foreach (Fougerite.Entity xx in Util.GetUtil().FindEntitiesAround(e.Location, 5f)) { if (xx.Name == "WoodDoorFrame") { if (xx.OwnerID == pl.SteamID) { return; } else { e.Destroy(); pl.MessageFrom(sys, orange + "You cannot place " + e.Name + " so close to doorways"); } } else if (xx.Name == "MetalDoorFrame") { if (xx.OwnerID == pl.SteamID) { return; } else { e.Destroy(); pl.MessageFrom(sys, orange + "You cannot place " + e.Name + " so close to doorways"); } } } } } else if (e.Name.ToLower().Contains("barricade")) { if (BlockBarricadeCloseToDoor) { foreach (Fougerite.Entity xx in Util.GetUtil().FindEntitiesAround(e.Location, 5f)) { if (xx.Name == "WoodDoorFrame") { if (xx.OwnerID == pl.SteamID) { return; } else { e.Destroy(); pl.MessageFrom(sys, orange + "You cannot place " + e.Name + " so close to doorways"); } } else if (xx.Name == "MetalDoorFrame") { if (xx.OwnerID == pl.SteamID) { return; } else { e.Destroy(); pl.MessageFrom(sys, orange + "You cannot place " + e.Name + " so close to doorways"); } } } } else if (e.Name == "WoodGate") { if (AntiGatewayStag) { foreach (Fougerite.Entity xx in Util.GetUtil().FindEntitiesAround(e.Location, 3f)) { if (xx.Name == "WoodGate") { e.Destroy(); { pl.MessageFrom(sys, orange + "You cannot double the Gates on this server :)"); } } } } } } }
public void OnEntityDeployed(Fougerite.Player pl, Fougerite.Entity e, Fougerite.Player actualplacer) { HasRustPP = true; if (HasRustPP == true) { foreach (Fougerite.Entity xx in Util.GetUtil().FindEntitiesAround(e.Location, 25f)) { if (e.Name == "WoodFoundation") { if (xx.Name == "WoodFoundation") { if (xx.OwnerID == actualplacer.SteamID) { } else { var friendc = Fougerite.Server.GetServer().GetRustPPAPI().GetFriendsCommand.GetFriendsLists(); if (friendc.ContainsKey(xx.UOwnerID)) { var fs = (RustPP.Social.FriendList)friendc[xx.UOwnerID]; bool isfriend = fs.Cast <FriendList.Friend>().Any(friend => friend.GetUserID() == actualplacer.UID); if (isfriend) { } else { e.Destroy(); { actualplacer.MessageFrom(Name, orange + "You are to close to someone else his structure cant build here"); actualplacer.Inventory.AddItem(e.Name, 1); actualplacer.SendConsoleMessage(aqua + "[ToolCubBoard]" + orange + "You are not allowed to build near this structure"); } } } } } else if (e.Name.ToLower().Contains("bench")) { if (xx.OwnerID == actualplacer.SteamID) { break; } else { var friendc = Fougerite.Server.GetServer().GetRustPPAPI().GetFriendsCommand.GetFriendsLists(); if (friendc.ContainsKey(xx.UOwnerID)) { var fs = (RustPP.Social.FriendList)friendc[xx.UOwnerID]; bool isfriend = fs.Cast <FriendList.Friend>().Any(friend => friend.GetUserID() == actualplacer.UID); if (isfriend) { break; } else { e.Destroy(); { actualplacer.MessageFrom(Name, orange + "You are to close to someone else his structure cant build here"); actualplacer.Inventory.AddItem(e.Name, 1); actualplacer.SendConsoleMessage(aqua + "[ToolCubBoard]" + orange + "You are not allowed to build near this structure"); } } } } } else if (e.Name.ToLower().Contains("spike")) { if (xx.OwnerID == actualplacer.SteamID) { break; } else { var friendc = Fougerite.Server.GetServer().GetRustPPAPI().GetFriendsCommand.GetFriendsLists(); if (friendc.ContainsKey(xx.UOwnerID)) { var fs = (RustPP.Social.FriendList)friendc[xx.UOwnerID]; bool isfriend = fs.Cast <FriendList.Friend>().Any(friend => friend.GetUserID() == actualplacer.UID); if (isfriend) { break; } else { e.Destroy(); { actualplacer.MessageFrom(Name, orange + "You are to close to someone else his structure cant build here"); actualplacer.Inventory.AddItem(e.Name, 1); actualplacer.SendConsoleMessage(aqua + "[ToolCubBoard]" + orange + "You are not allowed to build near this structure"); } } } } } else if (e.Name.ToLower().Contains("sleepingbaga")) { if (!AllowSleepingBags) { if (xx.OwnerID == actualplacer.SteamID) { break; } else { var friendc = Fougerite.Server.GetServer().GetRustPPAPI().GetFriendsCommand.GetFriendsLists(); if (friendc.ContainsKey(xx.UOwnerID)) { var fs = (RustPP.Social.FriendList)friendc[xx.UOwnerID]; bool isfriend = fs.Cast <FriendList.Friend>().Any(friend => friend.GetUserID() == actualplacer.UID); if (isfriend) { break; } else { e.Destroy(); { actualplacer.MessageFrom(Name, orange + "You are to close to someone else his structure cant build here"); actualplacer.Inventory.AddItem(e.Name, 1); actualplacer.SendConsoleMessage(aqua + "[ToolCubBoard]" + orange + "You are not allowed to build near this structure"); } } } } } } else if (e.Name.ToLower().Contains("bed")) { if (!AllowBeds) { if (xx.OwnerID == actualplacer.SteamID) { break; } else { var friendc = Fougerite.Server.GetServer().GetRustPPAPI().GetFriendsCommand.GetFriendsLists(); if (friendc.ContainsKey(xx.UOwnerID)) { var fs = (RustPP.Social.FriendList)friendc[xx.UOwnerID]; bool isfriend = fs.Cast <FriendList.Friend>().Any(friend => friend.GetUserID() == actualplacer.UID); if (isfriend) { break; } else { e.Destroy(); { actualplacer.MessageFrom(Name, orange + "You are to close to someone else his structure cant build here"); actualplacer.Inventory.AddItem(e.Name, 1); actualplacer.SendConsoleMessage(aqua + "[ToolCubBoard]" + orange + "You are not allowed to build near this structure"); } } } } } } else if (e.Name.ToLower().Contains("barricade")) { if (!AllowBarricade) { if (xx.OwnerID == actualplacer.SteamID) { break; } else { var friendc = Fougerite.Server.GetServer().GetRustPPAPI().GetFriendsCommand.GetFriendsLists(); if (friendc.ContainsKey(xx.UOwnerID)) { var fs = (RustPP.Social.FriendList)friendc[xx.UOwnerID]; bool isfriend = fs.Cast <FriendList.Friend>().Any(friend => friend.GetUserID() == actualplacer.UID); if (isfriend) { break; } else { e.Destroy(); { actualplacer.MessageFrom(Name, orange + "You are to close to someone else his structure cant build here"); actualplacer.Inventory.AddItem(e.Name, 1); actualplacer.SendConsoleMessage(aqua + "[ToolCubBoard]" + orange + "You are not allowed to build near this structure"); } } } } } } else if (e.Name.ToLower().Contains("storage")) { if (!AllowBoxes) { if (xx.OwnerID == actualplacer.SteamID) { break; } else { var friendc = Fougerite.Server.GetServer().GetRustPPAPI().GetFriendsCommand.GetFriendsLists(); if (friendc.ContainsKey(xx.UOwnerID)) { var fs = (RustPP.Social.FriendList)friendc[xx.UOwnerID]; bool isfriend = fs.Cast <FriendList.Friend>().Any(friend => friend.GetUserID() == actualplacer.UID); if (isfriend) { break; } else { e.Destroy(); { actualplacer.MessageFrom(Name, orange + "You are to close to someone else his structure cant build here"); actualplacer.Inventory.AddItem(e.Name, 1); actualplacer.SendConsoleMessage(aqua + "[ToolCubBoard]" + orange + "You are not allowed to build near this structure"); } } } } } } else if (e.Name.ToLower().Contains("gate")) { if (xx.OwnerID == actualplacer.SteamID) { break; } else { var friendc = Fougerite.Server.GetServer().GetRustPPAPI().GetFriendsCommand.GetFriendsLists(); if (friendc.ContainsKey(xx.UOwnerID)) { var fs = (RustPP.Social.FriendList)friendc[xx.UOwnerID]; bool isfriend = fs.Cast <FriendList.Friend>().Any(friend => friend.GetUserID() == actualplacer.UID); if (isfriend) { break; } else { e.Destroy(); { actualplacer.MessageFrom(Name, orange + "You are to close to someone else his structure cant build here"); actualplacer.Inventory.AddItem(e.Name, 1); actualplacer.SendConsoleMessage(aqua + "[ToolCubBoard]" + orange + "You are not allowed to build near this structure"); } } } } } else if (e.Name.ToLower().Contains("ramp")) { if (!AllowRamps) { if (xx.OwnerID == actualplacer.SteamID) { break; } else { var friendc = Fougerite.Server.GetServer().GetRustPPAPI().GetFriendsCommand.GetFriendsLists(); if (friendc.ContainsKey(xx.UOwnerID)) { var fs = (RustPP.Social.FriendList)friendc[xx.UOwnerID]; bool isfriend = fs.Cast <FriendList.Friend>().Any(friend => friend.GetUserID() == actualplacer.UID); if (isfriend) { break; } else { e.Destroy(); { actualplacer.MessageFrom(Name, orange + "You are to close to someone else his structure cant build here"); actualplacer.Inventory.AddItem(e.Name, 1); actualplacer.SendConsoleMessage(aqua + "[ToolCubBoard]" + orange + "You are not allowed to build near this structure"); } } } } } } } } } }
public void EntityDeployed(Fougerite.Player Player, Fougerite.Entity Entity) { if (Entity != null) { if (Entity.Name.Contains("Foundation") || Entity.Name.Contains("Ramp") || Entity.Name.Contains("Pillar")) { string name = Entity.Name; var location = Entity.Location; DeployableObject[] deploylist = UnityEngine.Object.FindObjectsOfType(typeof(DeployableObject)) as DeployableObject[]; if (deploylist != null && deploylist.Where(ent => ent.name.Contains("WoodBox") || ent.name.Contains("Stash")).Any(ent => !(Util.GetUtil().GetVectorsDistance(location, ent.gameObject.transform.position) > 3.7))) { if (Player.IsOnline && GiveBack) { switch (name) { case "WoodFoundation": name = "Wood Foundation"; break; case "MetalFoundation": name = "Metal Foundation"; break; case "WoodRamp": name = "Wood Ramp"; break; case "MetalRamp": name = "Metal Ramp"; break; case "WoodPillar": name = "Wood Pillar"; break; case "MetalPillar": name = "Metal Pillar"; break; } Player.Inventory.AddItem(name, 1); } Entity.Destroy(); return; } StructureComponent[] structurelist = UnityEngine.Object.FindObjectsOfType(typeof(StructureComponent)) as StructureComponent[]; if (structurelist != null && structurelist.Where(structure => structure.name.Contains("Ramp") && Entity.InstanceID != structure.GetInstanceID()).Any(structure => Util.GetUtil().GetVectorsDistance(location, structure.gameObject.transform.position) == 0)) { if (GiveBack && Player.IsOnline) { switch (name) { case "WoodFoundation": name = "Wood Foundation"; break; case "MetalFoundation": name = "Metal Foundation"; break; case "WoodRamp": name = "Wood Ramp"; break; case "MetalRamp": name = "Metal Ramp"; break; case "WoodPillar": name = "Wood Pillar"; break; case "MetalPillar": name = "Metal Pillar"; break; } Player.Inventory.AddItem(name, 1); } Entity.Destroy(); return; } } } }