Update for the new Oil Rig names from a few wipes ago and the new Rad Town monumentSolved

I've made an unofficial update to this plugin to fix the internal Oil Rig names that were changed a few wipes ago, and now to also add the new Rad Town monument. I had to also update the version number to 1.3.10 because of the new config entry that needs to be added for the new Rad Town monument.

@FastBurst: Would you be willing to officially merge this? Thank you in advance.

Here is the patch that needs to be applied to version 1.3.9 to update it:

--- ZoneManagerAutoZones.cs	2023-07-07 00:56:01.000000000 +0200
+++ ZoneManagerAutoZones.cs.orig 2024-10-11 20:10:21.352374200 +0200
@@ -7,7 +7,7 @@

namespace Oxide.Plugins
{
- [Info("Zone Manager Auto Zones", "FastBurst", "1.3.9")]
+ [Info("Zone Manager Auto Zones", "FastBurst", "1.3.10")]
[Description("Adds zones and domes to monuments automatically.")]

public class ZoneManagerAutoZones : RustPlugin
@@ -231,10 +231,10 @@
continue;
}

- if (monument.name.Contains("oilrigai2", CompareOptions.IgnoreCase))
+ if (monument.name.Contains("oilrig_1", CompareOptions.IgnoreCase))
{
string friendlyname = monument.displayPhrase.english;
- string ID = "oilrigai2";
+ string ID = "oilrig_1";

if (config.LargeOilRig.Enabled)
{
@@ -280,10 +280,10 @@
continue;
}

- if (monument.name.Contains("oilrigai", CompareOptions.IgnoreCase))
+ if (monument.name.Contains("oilrig_2", CompareOptions.IgnoreCase))
{
string friendlyname = "Small " + monument.displayPhrase.english;
- string ID = "oilrigai";
+ string ID = "oilrig_2";

if (config.SmallOilRig.Enabled)
{
@@ -2300,6 +2300,55 @@
}
continue;
}
+
+ if (monument.name.Contains("radtown_1", CompareOptions.IgnoreCase))
+ {
+ string friendlyname = monument.displayPhrase.english;
+ string ID = "radtown_1";
+
+ if (config.radTown.Enabled)
+ {
+ string[] messages = new string[8];
+ messages[0] = "name";
+ messages[1] = friendlyname;
+ messages[2] = "enter_message";
+ messages[3] = configData.Location.Monuments.radTown.EnterMessage;
+ messages[4] = "leave_message";
+ messages[5] = configData.Location.Monuments.radTown.LeaveMessage;
+ messages[6] = "radius";
+ messages[7] = Convert.ToInt32(configData.Location.Monuments.radTown.Radius).ToString();
+
+ ZoneManager?.CallHook("CreateOrUpdateZone", ID, messages, monument.transform.position);
+
+ if (configData.Location.Monuments.radTown.ZoneFlags != null)
+ foreach (var flag in configData.Location.Monuments.radTown.ZoneFlags)
+ ZoneManager?.CallHook("AddFlag", ID, flag);
+
+ if (configData.ZoneOption.UseTruePVE)
+ TruePVE?.CallHook("AddOrUpdateMapping", ID, configData.Location.Monuments.radTown.TruePVERules);
+ else if (configData.ZoneOption.UseNextGenPVE)
+ NextGenPVE?.CallHook("AddOrUpdateMapping", ID, configData.Location.Monuments.radTown.NextGenPVERules);
+
+ if (configData.ZoneOption.UseZoneDomes)
+ {
+ ZoneDomes?.CallHook("RemoveExistingDome", player, ID);
+ ZoneDomes?.CallHook("AddNewDome", player, ID);
+ }
+ }
+ else
+ {
+ ZoneManager?.CallHook("EraseZone", ID);
+
+ if (configData.ZoneOption.UseTruePVE)
+ TruePVE?.CallHook("RemoveMapping", ID);
+ else if (configData.ZoneOption.UseNextGenPVE)
+ NextGenPVE?.CallHook("RemoveMapping", ID);
+
+ if (configData.ZoneOption.UseZoneDomes)
+ ZoneDomes?.CallHook("RemoveExistingDome", player, ID);
+ }
+ continue;
+ }
}

if (configData.ZoneOption.UseZoneDomes)
@@ -2428,6 +2477,8 @@
public Options missileSilo { get; set; }
[JsonProperty(PropertyName = "Ferry Terminal")]
public Options ferryTerminal { get; set; }
+ [JsonProperty(PropertyName = "Rad Town")]
+ public Options radTown { get; set; }
public class Options
{
public bool Enabled { get; set; }
@@ -2940,6 +2991,16 @@
ZoneFlags = new string[] { "autolights" },
TruePVERules = "exclude",
NextGenPVERules = "exclude"
+ },
+ radTown = new ConfigData.LocationOptions.Monument.Options
+ {
+ Enabled = true,
+ Radius = 85,
+ EnterMessage = "WARNING: You are now entering a PVP Zone",
+ LeaveMessage = "Returning to PVE Area",
+ ZoneFlags = new string[] { "autolights" },
+ TruePVERules = "exclude",
+ NextGenPVERules = "exclude"
}
}
},
@@ -3073,6 +3134,11 @@
configData.Location.Monuments.ferryTerminal = baseConfig.Location.Monuments.ferryTerminal;
}

+ if (configData.Version < new Core.VersionNumber(1, 3, 10))
+ {
+ configData.Location.Monuments.radTown = baseConfig.Location.Monuments.radTown;
+ }
+

configData.Version = Version;
PrintWarning("Config update completed!");

-edit-

Merged post

Switched up the filenames at the top by mistake, fixed it:

--- ZoneManagerAutoZones.cs.orig	2023-07-07 00:56:01.000000000 +0200
+++ ZoneManagerAutoZones.cs 2024-10-11 20:10:21.352374200 +0200
@@ -7,7 +7,7 @@

namespace Oxide.Plugins
{
- [Info("Zone Manager Auto Zones", "FastBurst", "1.3.9")]
+ [Info("Zone Manager Auto Zones", "FastBurst", "1.3.10")]
[Description("Adds zones and domes to monuments automatically.")]

public class ZoneManagerAutoZones : RustPlugin
@@ -231,10 +231,10 @@
continue;
}

- if (monument.name.Contains("oilrigai2", CompareOptions.IgnoreCase))
+ if (monument.name.Contains("oilrig_1", CompareOptions.IgnoreCase))
{
string friendlyname = monument.displayPhrase.english;
- string ID = "oilrigai2";
+ string ID = "oilrig_1";

if (config.LargeOilRig.Enabled)
{
@@ -280,10 +280,10 @@
continue;
}

- if (monument.name.Contains("oilrigai", CompareOptions.IgnoreCase))
+ if (monument.name.Contains("oilrig_2", CompareOptions.IgnoreCase))
{
string friendlyname = "Small " + monument.displayPhrase.english;
- string ID = "oilrigai";
+ string ID = "oilrig_2";

if (config.SmallOilRig.Enabled)
{
@@ -2300,6 +2300,55 @@
}
continue;
}
+
+ if (monument.name.Contains("radtown_1", CompareOptions.IgnoreCase))
+ {
+ string friendlyname = monument.displayPhrase.english;
+ string ID = "radtown_1";
+
+ if (config.radTown.Enabled)
+ {
+ string[] messages = new string[8];
+ messages[0] = "name";
+ messages[1] = friendlyname;
+ messages[2] = "enter_message";
+ messages[3] = configData.Location.Monuments.radTown.EnterMessage;
+ messages[4] = "leave_message";
+ messages[5] = configData.Location.Monuments.radTown.LeaveMessage;
+ messages[6] = "radius";
+ messages[7] = Convert.ToInt32(configData.Location.Monuments.radTown.Radius).ToString();
+
+ ZoneManager?.CallHook("CreateOrUpdateZone", ID, messages, monument.transform.position);
+
+ if (configData.Location.Monuments.radTown.ZoneFlags != null)
+ foreach (var flag in configData.Location.Monuments.radTown.ZoneFlags)
+ ZoneManager?.CallHook("AddFlag", ID, flag);
+
+ if (configData.ZoneOption.UseTruePVE)
+ TruePVE?.CallHook("AddOrUpdateMapping", ID, configData.Location.Monuments.radTown.TruePVERules);
+ else if (configData.ZoneOption.UseNextGenPVE)
+ NextGenPVE?.CallHook("AddOrUpdateMapping", ID, configData.Location.Monuments.radTown.NextGenPVERules);
+
+ if (configData.ZoneOption.UseZoneDomes)
+ {
+ ZoneDomes?.CallHook("RemoveExistingDome", player, ID);
+ ZoneDomes?.CallHook("AddNewDome", player, ID);
+ }
+ }
+ else
+ {
+ ZoneManager?.CallHook("EraseZone", ID);
+
+ if (configData.ZoneOption.UseTruePVE)
+ TruePVE?.CallHook("RemoveMapping", ID);
+ else if (configData.ZoneOption.UseNextGenPVE)
+ NextGenPVE?.CallHook("RemoveMapping", ID);
+
+ if (configData.ZoneOption.UseZoneDomes)
+ ZoneDomes?.CallHook("RemoveExistingDome", player, ID);
+ }
+ continue;
+ }
}

if (configData.ZoneOption.UseZoneDomes)
@@ -2428,6 +2477,8 @@
public Options missileSilo { get; set; }
[JsonProperty(PropertyName = "Ferry Terminal")]
public Options ferryTerminal { get; set; }
+ [JsonProperty(PropertyName = "Rad Town")]
+ public Options radTown { get; set; }
public class Options
{
public bool Enabled { get; set; }
@@ -2940,6 +2991,16 @@
ZoneFlags = new string[] { "autolights" },
TruePVERules = "exclude",
NextGenPVERules = "exclude"
+ },
+ radTown = new ConfigData.LocationOptions.Monument.Options
+ {
+ Enabled = true,
+ Radius = 85,
+ EnterMessage = "WARNING: You are now entering a PVP Zone",
+ LeaveMessage = "Returning to PVE Area",
+ ZoneFlags = new string[] { "autolights" },
+ TruePVERules = "exclude",
+ NextGenPVERules = "exclude"
}
}
},
@@ -3073,6 +3134,11 @@
configData.Location.Monuments.ferryTerminal = baseConfig.Location.Monuments.ferryTerminal;
}

+ if (configData.Version < new Core.VersionNumber(1, 3, 10))
+ {
+ configData.Location.Monuments.radTown = baseConfig.Location.Monuments.radTown;
+ }
+

configData.Version = Version;
PrintWarning("Config update completed!");

quick question where do i put this? as not sure where it needs to go

I will be updating shortly I was in the hospital for a few months

included in new update

Locked automatically