I've added 2 method overloads for the Zone Domes API to allow creating and deleting of zones without the need for a player object, The code i have used is below. Could you please add it or something of a similar nature to the plugin as i would rather not have to maintain a local copy of the plugin.
[HookMethod("AddNewDome")]
public bool AddNewDome(string ID)
{
var zoneid = VerifyZoneID(ID);
if (zoneid is string && !string.IsNullOrEmpty((string)zoneid))
{
if (data.Zones.ContainsKey(ID))
{
Puts(GetMsg("alreadyExists"));
return false;
}
var pos = GetZoneLocation(ID);
if (pos != null && pos is Vector3)
{
var radius = GetZoneRadius(ID);
if (radius != null && radius is float)
{
CreateSphere((Vector3)pos, (float)radius);
data.Zones.Add(ID, new ZoneEntry { Position = (Vector3)pos, Radius = (float)radius });
SaveData();
Puts(GetMsg("newSuccess"));
return true;
}
else
{
Puts(GetMsg("noRad"));
return false;
}
}
else
{
Puts(GetMsg("noLoc"));
return false;
}
}
else
{
Puts(GetMsg("noVerify"));
return false;
}
} [HookMethod("RemoveExistingDome")]
public bool RemoveExistingDome(string ID)
{
if (data.Zones.ContainsKey(ID))
{
for (int i = 0; i < Spheres.Count; i++)
{
if (Spheres[i] != null)
{
if (Spheres[i].transform.position == data.Zones[ID].Position)
{
DestroySphere(Spheres[i]);
data.Zones.Remove(ID);
SaveData();
Puts(GetMsg("remSuccess"));
return true;
}
}
}
Puts(GetMsg("noEntity"));
Puts(GetMsg("remInvalid"));
return false;
}
else
{
Puts(GetMsg("noInfo"));
return false;
}
}