using System.Collections.Generic; using System.Collections; using Oxide.Core.Configuration; using Newtonsoft.Json; using Oxide.Core.Plugins; using UnityEngine; using System.Linq; using Oxide.Core; using System; using System.Globalization; namespace Oxide.Plugins { [Info("Event Tips Remover", "Razor", "1.0.3")] [Description("Remove new GameTip messages.")] public class EventTipsRemover : RustPlugin { List puzzleReset = new List(); #region Init private void OnServerInitialized() { //This Was The Only Way To Find PuzzleReset as no hooks available currenty in DoReset() foreach (var GateToRemove in GameObject.FindObjectsOfType()) { if (GateToRemove.broadcastResetMessage) { GateToRemove.broadcastResetMessage = false; puzzleReset.Add(GateToRemove); } } } private void Unload() { foreach (var GateToAdd in puzzleReset) { if (GateToAdd != null) GateToAdd.broadcastResetMessage = true; } } #endregion #region Hooks private object OnEventTrigger(TriggeredEventPrefab eventTrig) { Debug.Log((object)("[event] " + eventTrig.targetPrefab.resourcePath)); BaseEntity entity = GameManager.server.CreateEntity(eventTrig.targetPrefab.resourcePath); if (entity == null) return false; entity.SendMessage("TriggeredEventSpawn", SendMessageOptions.DontRequireReceiver); entity.Spawn(); return false; } private object OnExcavatorResourceSet(ExcavatorArm arm, string str, BasePlayer player) { if (str == "HQM") arm.resourceMiningIndex = 0; else if (str == "Sulfur") arm.resourceMiningIndex = 1; else if (str == "Stone") arm.resourceMiningIndex = 2; else if (str == "Metal") arm.resourceMiningIndex = 3; if (arm.IsOn()) return null; BeginMining(arm); return false; } public void BeginMining(ExcavatorArm arm) { if (!arm.IsPowered()) return; arm.SetFlag(BaseEntity.Flags.On, true); arm.InvokeRepeating(new Action(arm.ProduceResources), arm.resourceProductionTickRate, arm.resourceProductionTickRate); ExcavatorServerEffects.SetMining(true); //Facepunch.Rust.Analytics.Server.ExcavatorStarted(); //arm.excavatorStartTime = arm.GetNetworkTime(); Interface.CallHook("OnExcavatorMiningToggled", (object)arm); } #endregion } }