From 6be20bdb4c7e800f12283c4f388d720678c9940a Mon Sep 17 00:00:00 2001 From: Substrata1 <62188329+Substrata1@users.noreply.github.com> Date: Tue, 16 Jul 2024 20:10:30 -0400 Subject: [PATCH] Update vo v0.6.7 --- Inbound.cs | 21 ++++++++++++++++++++- README.md | 4 +++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Inbound.cs b/Inbound.cs index 50118d1..f7fb190 100644 --- a/Inbound.cs +++ b/Inbound.cs @@ -10,7 +10,7 @@ namespace Oxide.Plugins { - [Info("Inbound", "Substrata", "0.6.6")] + [Info("Inbound", "Substrata", "0.6.7")] [Description("Broadcasts notifications when patrol helicopters, supply drops, cargo ships, etc. are inbound")] class Inbound : RustPlugin @@ -103,6 +103,17 @@ void OnBradleyApcInitialize(BradleyAPC apc) }); } + void OnEntitySpawned(TravellingVendor travellingVendor) + { + if (!initialized) return; + + NextTick(() => + { + if (travellingVendor == null || travellingVendor.IsDestroyed) return; + SendInboundMessage(Lang("TravellingVendor", null, Location(travellingVendor.transform.position)), configData.alerts.travellingVendor); + }); + } + void OnExcavatorResourceSet(ExcavatorArm arm, string resourceName, BasePlayer player) { if (!initialized) return; @@ -544,6 +555,8 @@ public class Alerts public bool ch47 { get; set; } [JsonProperty(PropertyName = "Bradley APC Alerts")] public bool bradleyAPC { get; set; } + [JsonProperty(PropertyName = "Travelling Vendor Alerts")] + public bool travellingVendor { get; set; } [JsonProperty(PropertyName = "Excavator Activated Alerts")] public bool excavator { get; set; } [JsonProperty(PropertyName = "Excavator Supply Request Alerts")] @@ -662,6 +675,7 @@ private ConfigData GetBaseConfig() cargoPlane = true, ch47 = true, bradleyAPC = true, + travellingVendor = true, excavator = true, excavatorSupply = true, hackableCrateSpawn = true, @@ -739,6 +753,10 @@ private void UpdateConfigValues() { configData.alerts.cargoShipHarbor = baseConfig.alerts.cargoShipHarbor; } + if (configData.Version < new Core.VersionNumber(0, 6, 7)) + { + configData.alerts.travellingVendor = baseConfig.alerts.travellingVendor; + } configData.Version = Version; PrintWarning("Config update completed!"); } @@ -777,6 +795,7 @@ protected override void LoadDefaultMessages() ["CargoPlane_"] = "{0}Cargo Plane inbound{1}{2}", ["CH47"] = "Chinook inbound{0}{1}", ["BradleyAPC"] = "Bradley APC inbound{0}", + ["TravellingVendor"] = "Travelling Vendor inbound{0}", ["Excavator_"] = "{0} has activated The Excavator{1}", ["ExcavatorSupplyRequest"] = "{0} has requested a supply drop{1}", ["HackableCrateSpawned"] = "Hackable Crate has spawned{0}", diff --git a/README.md b/README.md index a9e39a4..762dd34 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ "Cargo Plane Alerts": true, "CH47 Chinook Alerts": true, "Bradley APC Alerts": true, + "Travelling Vendor Alerts": true, "Excavator Activated Alerts": true, "Excavator Supply Request Alerts": true, "Hackable Crate Alerts": true, @@ -61,7 +62,7 @@ "Version (Do not modify)": { "Major": 0, "Minor": 6, - "Patch": 6 + "Patch": 7 } } ``` @@ -83,6 +84,7 @@ "CargoPlane_": "{0}Cargo Plane inbound{1}{2}", "CH47": "Chinook inbound{0}{1}", "BradleyAPC": "Bradley APC inbound{0}", + "TravellingVendor": "Travelling Vendor inbound{0}", "Excavator_": "{0} has activated The Excavator{1}", "ExcavatorSupplyRequest": "{0} has requested a supply drop{1}", "HackableCrateSpawned": "Hackable Crate has spawned{0}",