C#:
//#define DEBUG
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using Facepunch;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using Oxide.Core;
using Oxide.Core.Configuration;
using Oxide.Core.Plugins;
using Oxide.Game.Rust;
using Rust;
using UnityEngine;
using static UnityEngine.Vector3;
using System.Text.RegularExpressions;
namespace Oxide.Plugins {
[Info("NTeleportation", "RFC1920", "1.0.52", ResourceId = 1832)]
class NTeleportation : RustPlugin {
private static readonly Vector3 Up = up;
private static readonly Vector3 Down = down;
private const string NewLine = "\n";
private const string ConfigDefaultPermVip = "nteleportation.vip";
private const string PermHome = "nteleportation.home";
private const string PermTpR = "nteleportation.tpr";
private const string PermDeleteHome = "nteleportation.deletehome";
private const string PermHomeHomes = "nteleportation.homehomes";
private const string PermImportHomes = "nteleportation.importhomes";
private const string PermRadiusHome = "nteleportation.radiushome";
private const string PermTp = "nteleportation.tp";
private const string PermTpB = "nteleportation.tpb";
private const string PermTpConsole = "nteleportation.tpconsole";
private const string PermTpHome = "nteleportation.tphome";
private const string PermTpTown = "nteleportation.tptown";
private const string PermTpN = "nteleportation.tpn";
private const string PermTpL = "nteleportation.tpl";
private const string PermTpRemove = "nteleportation.tpremove";
private const string PermTpSave = "nteleportation.tpsave";
private const string PermWipeHomes = "nteleportation.wipehomes";
private const string PermCraftHome = "nteleportation.crafthome";
private const string PermCraftTown = "nteleportation.crafttown";
private const string PermCraftTpR = "nteleportation.crafttpr";
private DynamicConfigFile dataAdmin;
private DynamicConfigFile dataHome;
private DynamicConfigFile dataTPR;
private DynamicConfigFile dataTown;
private Dictionary<ulong, AdminData> Admin;
private Dictionary<ulong, HomeData> Home;
private Dictionary<ulong, TeleportData> TPR;
private Dictionary<ulong, TeleportData> Town;
private bool changedAdmin;
private bool changedHome;
private bool changedTPR;
private bool changedTown;
private ConfigData configData;
private float boundary;
private readonly int triggerLayer = LayerMask.GetMask("Trigger");
private readonly int groundLayer = LayerMask.GetMask("Terrain", "World");
private readonly int buildingLayer = LayerMask.GetMask("Terrain", "World", "Construction", "Deployed");
private readonly int blockLayer = LayerMask.GetMask("Construction");
private readonly Dictionary<ulong, TeleportTimer> TeleportTimers = new Dictionary<ulong, TeleportTimer>();
private readonly Dictionary<ulong, Timer> PendingRequests = new Dictionary<ulong, Timer>();
private readonly Dictionary<ulong, BasePlayer> PlayersRequests = new Dictionary<ulong, BasePlayer>();
private readonly Dictionary<int, string> ReverseBlockedItems = new Dictionary<int, string>();
private readonly HashSet<ulong> teleporting = new HashSet<ulong>();
private SortedDictionary<string, Vector3> monPos = new SortedDictionary<string, Vector3>();
private SortedDictionary<string, Vector3> monSize = new SortedDictionary<string, Vector3>();
private SortedDictionary<string, Vector3> cavePos = new SortedDictionary<string, Vector3>();
[PluginReference]
private Plugin Clans, Economics, ServerRewards, Friends, RustIO;
class ConfigData {
public SettingsData Settings {
get;
set;
}
public AdminSettingsData Admin {
get;
set;
}
public HomesSettingsData Home {
get;
set;
}
public TPRData TPR {
get;
set;
}
public TownData Town {
get;
set;
}
public VersionNumber Version {
get;
set;
}
}
class SettingsData {
public string ChatName {
get;
set;
}
public bool HomesEnabled {
get;
set;
}
public bool TPREnabled {
get;
set;
}
public bool TownEnabled {
get;
set;
}
public bool InterruptTPOnHurt {
get;
set;
}
public bool InterruptTPOnCold {
get;
set;
}
public bool InterruptTPOnHot {
get;
set;
}
public bool InterruptTPOnSafe {
get;
set;
}
public bool InterruptTPOnBalloon {
get;
set;
}
public bool InterruptTPOnCargo {
get;
set;
}
public bool InterruptTPOnLift {
get;
set;
}
public bool InterruptTPOnMonument {
get;
set;
}
public float CaveDistanceSmall {
get;
set;
}
public float CaveDistanceMedium {
get;
set;
}
public float CaveDistanceLarge {
get;
set;
}
public float DefaultMonumentSize {
get;
set;
}
public float MinimumTemp {
get;
set;
}
public float MaximumTemp {
get;
set;
}
public Dictionary<string, string> BlockedItems {
get;
set;
}
= new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
public string BypassCMD {
get;
set;
}
public bool UseEconomics {
get;
set;
}
public bool UseServerRewards {
get;
set;
}
}
class AdminSettingsData {
public bool AnnounceTeleportToTarget {
get;
set;
}
public bool UseableByAdmins {
get;
set;
}
public bool UseableByModerators {
get;
set;
}
public int LocationRadius {
get;
set;
}
public int TeleportNearDefaultDistance {
get;
set;
}
}
class HomesSettingsData {
public int HomesLimit {
get;
set;
}
public Dictionary<string, int> VIPHomesLimits {
get;
set;
}
public int Cooldown {
get;
set;
}
public int Countdown {
get;
set;
}
public int DailyLimit {
get;
set;
}
public Dictionary<string, int> VIPDailyLimits {
get;
set;
}
public Dictionary<string, int> VIPCooldowns {
get;
set;
}
public Dictionary<string, int> VIPCountdowns {
get;
set;
}
public int LocationRadius {
get;
set;
}
public bool ForceOnTopOfFoundation {
get;
set;
}
public bool CheckFoundationForOwner {
get;
set;
}
public bool UseFriends {
get;
set;
}
public bool UsableOutOfBuildingBlocked {
get;
set;
}
public bool UsableIntoBuildingBlocked {
get;
set;
}
public bool CupOwnerAllowOnBuildingBlocked {
get;
set;
}
public bool AllowIceberg {
get;
set;
}
public bool AllowCave {
get;
set;
}
public bool AllowCraft {
get;
set;
}
public bool AllowAboveFoundation {
get;
set;
}
public bool CheckValidOnList {
get;
set;
}
public int Pay {
get;
set;
}
public int Bypass {
get;
set;
}
}
class TPRData {
public int Cooldown {
get;
set;
}
public int Countdown {
get;
set;
}
public int DailyLimit {
get;
set;
}
public Dictionary<string, int> VIPDailyLimits {
get;
set;
}
public Dictionary<string, int> VIPCooldowns {
get;
set;
}
public Dictionary<string, int> VIPCountdowns {
get;
set;
}
public int RequestDuration {
get;
set;
}
public bool OffsetTPRTarget {
get;
set;
}
public bool BlockTPAOnCeiling {
get;
set;
}
public bool UsableOutOfBuildingBlocked {
get;
set;
}
public bool UsableIntoBuildingBlocked {
get;
set;
}
public bool CupOwnerAllowOnBuildingBlocked {
get;
set;
}
public bool AllowCraft {
get;
set;
}
public int Pay {
get;
set;
}
public int Bypass {
get;
set;
}
}
class TownData {
public int Cooldown {
get;
set;
}
public int Countdown {
get;
set;
}
public int DailyLimit {
get;
set;
}
public Dictionary<string, int> VIPDailyLimits {
get;
set;
}
public Dictionary<string, int> VIPCooldowns {
get;
set;
}
public Dictionary<string, int> VIPCountdowns {
get;
set;
}
public Vector3 Location {
get;
set;
}
public bool UsableOutOfBuildingBlocked {
get;
set;
}
public bool AllowCraft {
get;
set;
}
public int Pay {
get;
set;
}
public int Bypass {
get;
set;
}
}
class AdminData {
[JsonProperty("pl")]
public Vector3 PreviousLocation {
get;
set;
}
[JsonProperty("l")]
public Dictionary<string, Vector3> Locations {
get;
set;
}
= new Dictionary<string, Vector3>(StringComparer.OrdinalIgnoreCase);
}
class HomeData {
[JsonProperty("l")]
public Dictionary<string, Vector3> Locations {
get;
set;
}
= new Dictionary<string, Vector3>(StringComparer.OrdinalIgnoreCase);
[JsonProperty("t")]
public TeleportData Teleports {
get;
set;
}
= new TeleportData();
}
class TeleportData {
[JsonProperty("a")]
public int Amount {
get;
set;
}
[JsonProperty("d")]
public string Date {
get;
set;
}
[JsonProperty("t")]
public int Timestamp {
get;
set;
}
}
class TeleportTimer {
public Timer Timer {
get;
set;
}
public BasePlayer OriginPlayer {
get;
set;
}
public BasePlayer TargetPlayer {
get;
set;
}
}
protected override void LoadDefaultConfig() {
Config.Settings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
Config.Settings.Converters = new JsonConverter[] {
new UnityVector3Converter()
}
;
Config.WriteObject(new ConfigData {
Settings = new SettingsData {
ChatName = "<color=red>Teleportation</color>: ", HomesEnabled = true, TPREnabled = true, TownEnabled = true, InterruptTPOnHurt = true, InterruptTPOnCold = false, InterruptTPOnHot = false, MinimumTemp = 0f, MaximumTemp = 40f, InterruptTPOnSafe = true, InterruptTPOnBalloon = true, InterruptTPOnCargo = true, InterruptTPOnLift = true, InterruptTPOnMonument = false, CaveDistanceSmall = 40f, CaveDistanceMedium = 60f, CaveDistanceLarge = 100f, DefaultMonumentSize = 50f, BypassCMD = "pay", UseEconomics = false, UseServerRewards = false
}
, Admin = new AdminSettingsData {
AnnounceTeleportToTarget = false, UseableByAdmins = true, UseableByModerators = true, LocationRadius = 25, TeleportNearDefaultDistance = 30
}
, Home = new HomesSettingsData {
HomesLimit = 2, VIPHomesLimits = new Dictionary<string, int> {
{
ConfigDefaultPermVip, 5
}
}
, Cooldown = 600, Countdown = 15, DailyLimit = 5, VIPDailyLimits = new Dictionary<string, int> {
{
ConfigDefaultPermVip, 5
}
}
, VIPCooldowns = new Dictionary<string, int> {
{
ConfigDefaultPermVip, 5
}
}
, VIPCountdowns = new Dictionary<string, int> {
{
ConfigDefaultPermVip, 5
}
}
, LocationRadius = 25, ForceOnTopOfFoundation = true, CheckFoundationForOwner = true, UseFriends = true, AllowAboveFoundation = true, CheckValidOnList = false, CupOwnerAllowOnBuildingBlocked = true
}
, TPR = new TPRData {
Cooldown = 600, Countdown = 15, DailyLimit = 5, VIPDailyLimits = new Dictionary<string, int> {
{
ConfigDefaultPermVip, 5
}
}
, VIPCooldowns = new Dictionary<string, int> {
{
ConfigDefaultPermVip, 5
}
}
, VIPCountdowns = new Dictionary<string, int> {
{
ConfigDefaultPermVip, 5
}
}
, RequestDuration = 30, BlockTPAOnCeiling = true, OffsetTPRTarget = true, CupOwnerAllowOnBuildingBlocked = true
}
, Town = new TownData {
Cooldown = 600, Countdown = 15, DailyLimit = 5, VIPDailyLimits = new Dictionary<string, int> {
{
ConfigDefaultPermVip, 5
}
}
, VIPCooldowns = new Dictionary<string, int> {
{
ConfigDefaultPermVip, 5
}
}
, VIPCountdowns = new Dictionary<string, int> {
{
ConfigDefaultPermVip, 5
}
}
}
, Version = Version
}
, true);
}
private void Init() {
lang.RegisterMessages(new Dictionary<string, string> {
{
"AdminTP", "You teleported to {0}!"
}
, {
"AdminTPTarget", "{0} teleported to you!"
}
, {
"AdminTPPlayers", "You teleported {0} to {1}!"
}
, {
"AdminTPPlayer", "{0} teleported you to {1}!"
}
, {
"AdminTPPlayerTarget", "{0} teleported {1} to you!"
}
, {
"AdminTPCoordinates", "You teleported to {0}!"
}
, {
"AdminTPTargetCoordinates", "You teleported {0} to {1}!"
}
, {
"AdminTPOutOfBounds", "You tried to teleport to a set of coordinates outside the map boundaries!"
}
, {
"AdminTPBoundaries", "X and Z values need to be between -{0} and {0} while the Y value needs to be between -100 and 2000!"
}
, {
"AdminTPLocation", "You teleported to {0}!"
}
, {
"AdminTPLocationSave", "You have saved the current location!"
}
, {
"AdminTPLocationRemove", "You have removed the location {0}!"
}
, {
"AdminLocationList", "The following locations are available:"
}
, {
"AdminLocationListEmpty", "You haven't saved any locations!"
}
, {
"AdminTPBack", "You've teleported back to your previous location!"
}
, {
"AdminTPBackSave", "Your previous location has been saved, use /tpb to teleport back!"
}
, {
"AdminTPTargetCoordinatesTarget", "{0} teleported you to {1}!"
}
, {
"AdminTPConsoleTP", "You were teleported to {0}"
}
, {
"AdminTPConsoleTPPlayer", "You were teleported to {0}"
}
, {
"AdminTPConsoleTPPlayerTarget", "{0} was teleported to you!"
}
, {
"HomeTP", "You teleported to your home '{0}'!"
}
, {
"HomeAdminTP", "You teleported to {0}'s home '{1}'!"
}
, {
"HomeSave", "You have saved the current location as your home!"
}
, {
"HomeNoFoundation", "You can only use a home location on a foundation!"
}
, {
"HomeFoundationNotOwned", "You can't use home on someone else's house."
}
, {
"HomeFoundationUnderneathFoundation", "You can't use home on a foundation that is underneath another foundation."
}
, {
"HomeFoundationNotFriendsOwned", "You or a friend need to own the house to use home!"
}
, {
"HomeRemovedInvalid", "Your home '{0}' was removed because not on a foundation or not owned!"
}
, {
"HomeRemovedInsideBlock", "Your home '{0}' was removed because inside a foundation!"
}
, {
"HomeRemove", "You have removed your home {0}!"
}
, {
"HomeDelete", "You have removed {0}'s home '{1}'!"
}
, {
"HomeList", "The following homes are available:"
}
, {
"HomeListEmpty", "You haven't saved any homes!"
}
, {
"HomeMaxLocations", "Unable to set your home here, you have reached the maximum of {0} homes!"
}
, {
"HomeQuota", "You have set {0} of the maximum {1} homes!"
}
, {
"HomeTPStarted", "Teleporting to your home {0} in {1} seconds!"
}
, {
"PayToHome", "Standard payment of {0} applies to all home teleports!"
}
, {
"PayToTown", "Standard payment of {0} applies to all town teleports!"
}
, {
"PayToTPR", "Standard payment of {0} applies to all tprs!"
}
, {
"HomeTPCooldown", "Your teleport is currently on cooldown.You'll have to wait {0} for your next teleport."
}
, {
"HomeTPCooldownBypass", "Your teleport was currently on cooldown.You chose to bypass that by paying {0} from your balance."
}
, {
"HomeTPCooldownBypassF", "Your teleport is currently on cooldown.You do not have sufficient funds - {0} - to bypass."
}
, {
"HomeTPCooldownBypassP", "You may choose to pay {0} to bypass this cooldown."
}
, {
"HomeTPCooldownBypassP2", "Type /home NAME {0}."
}
, {
"HomeTPLimitReached", "You have reached the daily limit of {0} teleports today!"
}
, {
"HomeTPAmount", "You have {0} home teleports left today!"
}
, {
"HomesListWiped", "You have wiped all the saved home locations!"
}
, {
"HomeTPBuildingBlocked", "You can't set your home if you are not allowed to build in this zone!"
}
, {
"HomeTPSwimming", "You can't set your home while swimming!"
}
, {
"HomeTPCrafting", "You can't set your home while crafting!"
}
, {
"Request", "You've requested a teleport to {0}!"
}
, {
"RequestTarget", "{0} requested to be teleported to you! Use '/tpa' to accept!"
}
, {
"PendingRequest", "You already have a request pending, cancel that request or wait until it gets accepted or times out!"
}
, {
"PendingRequestTarget", "The player you wish to teleport to already has a pending request, try again later!"
}
, {
"NoPendingRequest", "You have no pending teleport request!"
}
, {
"AcceptOnRoof", "You can't accept a teleport while you're on a ceiling, get to ground level!"
}
, {
"Accept", "{0} has accepted your teleport request! Teleporting in {1} seconds!"
}
, {
"AcceptTarget", "You've accepted the teleport request of {0}!"
}
, {
"NotAllowed", "You are not allowed to use this command!"
}
, {
"Success", "You teleported to {0}!"
}
, {
"SuccessTarget", "{0} teleported to you!"
}
, {
"Cancelled", "Your teleport request to {0} was cancelled!"
}
, {
"CancelledTarget", "{0} teleport request was cancelled!"
}
, {
"TPCancelled", "Your teleport was cancelled!"
}
, {
"TPCancelledTarget", "{0} cancelled teleport!"
}
, {
"TPYouCancelledTarget", "You cancelled {0} teleport!"
}
, {
"TimedOut", "{0} did not answer your request in time!"
}
, {
"TimedOutTarget", "You did not answer {0}'s teleport request in time!"
}
, {
"TargetDisconnected", "{0} has disconnected, your teleport was cancelled!"
}
, {
"TPRCooldown", "Your teleport requests are currently on cooldown.You'll have to wait {0} to send your next teleport request."
}
, {
"TPRCooldownBypass", "Your teleport request was on cooldown.You chose to bypass that by paying {0} from your balance."
}
, {
"TPRCooldownBypassF", "Your teleport is currently on cooldown.You do not have sufficient funds - {0} - to bypass."
}
, {
"TPRCooldownBypassP", "You may choose to pay {0} to bypass this cooldown."
}
, {
"TPMoney", "{0} deducted from your account!"
}
, {
"TPNoMoney", "You do not have {0} in any account!"
}
, {
"TPRCooldownBypassP2", "Type /tpr {0}."
}
, {
"TPRCooldownBypassP2a", "Type /tpr NAME {0}."
}
, {
"TPRLimitReached", "You have reached the daily limit of {0} teleport requests today!"
}
, {
"TPRAmount", "You have {0} teleport requests left today!"
}
, {
"TPRTarget", "Your target is currently not available!"
}
, {
"TPDead", "You can't teleport while being dead!"
}
, {
"TPWounded", "You can't teleport while wounded!"
}
, {
"TPTooCold", "You're too cold to teleport!"
}
, {
"TPTooHot", "You're too hot to teleport!"
}
, {
"TPMounted", "You can't teleport while seated!"
}
, {
"TPBuildingBlocked", "You can't teleport while in a building blocked zone!"
}
, {
"TPTargetBuildingBlocked", "You can't teleport in a building blocked zone!"
}
, {
"TPTargetInsideBlock", "You can't teleport into a foundation!"
}
, {
"TPSwimming", "You can't teleport while swimming!"
}
, {
"TPCargoShip", "You can't teleport from the cargo ship!"
}
, {
"TPHotAirBalloon", "You can't teleport to or from a hot air balloon!"
}
, {
"TPLift", "You can't teleport while in an elevator or bucket lift!"
}
, {
"TPBucketLift", "You can't teleport while in a bucket lift!"
}
, {
"TPRegLift", "You can't teleport while in an elevator!"
}
, {
"TPSafeZone", "You can't teleport from a safezone!"
}
, {
"TPCrafting", "You can't teleport while crafting!"
}
, {
"TPBlockedItem", "You can't teleport while carrying: {0}!"
}
, {
"TooCloseToMon", "You can't teleport so close to the {0}!"
}
, {
"TooCloseToCave", "You can't teleport so close to a cave!"
}
, {
"HomeTooCloseToCave", "You can't set home so close to a cave!"
}
, {
"TownTP", "You teleported to town!"
}
, {
"TownTPNotSet", "Town is currently not set!"
}
, {
"TownTPDisabled", "Town is currently not enabled!"
}
, {
"TownTPLocation", "You have set the town location set to {0}!"
}
, {
"TownTPStarted", "Teleporting to town in {0} seconds!"
}
, {
"TownTPCooldown", "Your teleport is currently on cooldown.You'll have to wait {0} for your next teleport."
}
, {
"TownTPCooldownBypass", "Your teleport request was on cooldown.You chose to bypass that by paying {0} from your balance."
}
, {
"TownTPCooldownBypassF", "Your teleport is currently on cooldown.You do not have sufficient funds - {0} - to bypass."
}
, {
"TownTPCooldownBypassP", "You may choose to pay {0} to bypass this cooldown."
}
, {
"TownTPCooldownBypassP2", "Type /town {0}."
}
, {
"TownTPLimitReached", "You have reached the daily limit of {0} teleports today!"
}
, {
"TownTPAmount", "You have {0} town teleports left today!"
}
, {
"Interrupted", "Your teleport was interrupted!"
}
, {
"InterruptedTarget", "{0}'s teleport was interrupted!"
}
, {
"Unlimited", "Unlimited"
}
, {
"TPInfoGeneral", string.Join(NewLine, new[] {
"Please specify the module you want to view the info of.", "The available modules are: ",
}
)
}
, {
"TPHelpGeneral", string.Join(NewLine, new[] {
"/tpinfo - Shows limits and cooldowns.", "Please specify the module you want to view the help of.", "The available modules are: ",
}
)
}
, {
"TPHelpadmintp", string.Join(NewLine, new[] {
"As an admin you have access to the following commands:", "/tp \"targetplayer\" - Teleports yourself to the target player.", "/tp \"player\" \"targetplayer\" - Teleports the player to the target player.", "/tp x y z - Teleports you to the set of coordinates.", "/tpl - Shows a list of saved locations.", "/tpl \"location name\" - Teleports you to a saved location.", "/tpsave \"location name\" - Saves your current position as the location name.", "/tpremove \"location name\" - Removes the location from your saved list.", "/tpb - Teleports you back to the place where you were before teleporting.", "/home radius \"radius\" - Find all homes in radius.", "/home delete \"player name|id\" \"home name\" - Remove a home from a player.", "/home tp \"player name|id\" \"name\" - Teleports you to the home location with the name 'name' from the player.", "/home homes \"player name|id\" - Shows you a list of all homes from the player."
}
)
}
, {
"TPHelphome", string.Join(NewLine, new[] {
"With the following commands you can set your home location to teleport back to:", "/home add \"name\" - Saves your current position as the location name.", "/home list - Shows you a list of all the locations you have saved.", "/home remove \"name\" - Removes the location of your saved homes.", "/home \"name\" - Teleports you to the home location."
}
)
}
, {
"TPHelptpr", string.Join(NewLine, new[] {
"With these commands you can request to be teleported to a player or accept someone else's request:", "/tpr \"player name\" - Sends a teleport request to the player.", "/tpa - Accepts an incoming teleport request.", "/tpc - Cancel teleport or request."
}
)
}
, {
"TPSettingsGeneral", string.Join(NewLine, new[] {
"Please specify the module you want to view the settings of.", "The available modules are:",
}
)
}
, {
"TPSettingshome", string.Join(NewLine, new[] {
"Home System has the current settings enabled:", "Time between teleports: {0}", "Daily amount of teleports: {1}", "Amount of saved Home locations: {2}"
}
)
}
, {
"TPSettingstpr", string.Join(NewLine, new[] {
"TPR System has the current settings enabled:", "Time between teleports: {0}", "Daily amount of teleports: {1}"
}
)
}
, {
"TPSettingstown", string.Join(NewLine, new[] {
"Town System has the current settings enabled:", "Time between teleports: {0}", "Daily amount of teleports: {1}"
}
)
}
, {
"PlayerNotFound", "The specified player couldn't be found please try again!"
}
, {
"MultiplePlayers", "Found multiple players: {0}"
}
, {
"CantTeleportToSelf", "You can't teleport to yourself!"
}
, {
"CantTeleportPlayerToSelf", "You can't teleport a player to himself!"
}
, {
"TeleportPending", "You can't initiate another teleport while you have a teleport pending!"
}
, {
"TeleportPendingTarget", "You can't request a teleport to someone who's about to teleport!"
}
, {
"LocationExists", "A location with this name already exists at {0}!"
}
, {
"LocationExistsNearby", "A location with the name {0} already exists near this position!"
}
, {
"LocationNotFound", "Couldn't find a location with that name!"
}
, {
"NoPreviousLocationSaved", "No previous location saved!"
}
, {
"HomeExists", "You have already saved a home location by this name!"
}
, {
"HomeExistsNearby", "A home location with the name {0} already exists near this position!"
}
, {
"HomeNotFound", "Couldn't find your home with that name!"
}
, {
"InvalidCoordinates", "The coordinates you've entered are invalid!"
}
, {
"InvalidHelpModule", "Invalid module supplied!"
}
, {
"InvalidCharacter", "You have used an invalid character, please limit yourself to the letters a to z and numbers."
}
, {
"SyntaxCommandTP", string.Join(NewLine, new[] {
"A Syntax Error Occurred!", "You can only use the /tp command as follows:", "/tp \"targetplayer\" - Teleports yourself to the target player.", "/tp \"player\" \"targetplayer\" - Teleports the player to the target player.", "/tp x y z - Teleports you to the set of coordinates.", "/tp \"player\" x y z - Teleports the player to the set of coordinates."
}
)
}
, {
"SyntaxCommandTPL", string.Join(NewLine, new[] {
"A Syntax Error Occurred!", "You can only use the /tpl command as follows:", "/tpl - Shows a list of saved locations.", "/tpl \"location name\" - Teleports you to a saved location."
}
)
}
, {
"SyntaxCommandTPSave", string.Join(NewLine, new[] {
"A Syntax Error Occurred!", "You can only use the /tpsave command as follows:", "/tpsave \"location name\" - Saves your current position as 'location name'."
}
)
}
, {
"SyntaxCommandTPRemove", string.Join(NewLine, new[] {
"A Syntax Error Occurred!", "You can only use the /tpremove command as follows:", "/tpremove \"location name\" - Removes the location with the name 'location name'."
}
)
}
, {
"SyntaxCommandTPN", string.Join(NewLine, new[] {
"A Syntax Error Occurred!", "You can only use the /tpn command as follows:", "/tpn \"targetplayer\" - Teleports yourself the default distance behind the target player.", "/tpn \"targetplayer\" \"distance\" - Teleports you the specified distance behind the target player."
}
)
}
, {
"SyntaxCommandSetHome", string.Join(NewLine, new[] {
"A Syntax Error Occurred!", "You can only use the /home add command as follows:", "/home add \"name\" - Saves the current location as your home with the name 'name'."
}
)
}
, {
"SyntaxCommandRemoveHome", string.Join(NewLine, new[] {
"A Syntax Error Occurred!", "You can only use the /home remove command as follows:", "/home remove \"name\" - Removes the home location with the name 'name'."
}
)
}
, {
"SyntaxCommandHome", string.Join(NewLine, new[] {
"A Syntax Error Occurred!", "You can only use the /home command as follows:", "/home \"name\" - Teleports yourself to your home with the name 'name'.", "/home \"name\" pay - Teleports yourself to your home with the name 'name', avoiding cooldown by paying for it.", "/home add \"name\" - Saves the current location as your home with the name 'name'.", "/home list - Shows you a list of all your saved home locations.", "/home remove \"name\" - Removes the home location with the name 'name'."
}
)
}
, {
"SyntaxCommandHomeAdmin", string.Join(NewLine, new[] {
"/home radius \"radius\" - Shows you a list of all homes in radius(10).", "/home delete \"player name|id\" \"name\" - Removes the home location with the name 'name' from the player.", "/home tp \"player name|id\" \"name\" - Teleports you to the home location with the name 'name' from the player.", "/home homes \"player name|id\" - Shows you a list of all homes from the player."
}
)
}
, {
"SyntaxCommandTown", string.Join(NewLine, new[] {
"A Syntax Error Occurred!", "You can only use the /town command as follows:", "/town - Teleports yourself to town.", "/town pay - Teleports yourself to town, paying the penalty."
}
)
}
, {
"SyntaxCommandTownAdmin", string.Join(NewLine, new[] {
"/town set - Saves the current location as town.",
}
)
}
, {
"SyntaxCommandHomeDelete", string.Join(NewLine, new[] {
"A Syntax Error Occurred!", "You can only use the /home delete command as follows:", "/home delete \"player name|id\" \"name\" - Removes the home location with the name 'name' from the player."
}
)
}
, {
"SyntaxCommandHomeAdminTP", string.Join(NewLine, new[] {
"A Syntax Error Occurred!", "You can only use the /home tp command as follows:", "/home tp \"player name|id\" \"name\" - Teleports you to the home location with the name 'name' from the player."
}
)
}
, {
"SyntaxCommandHomeHomes", string.Join(NewLine, new[] {
"A Syntax Error Occurred!", "You can only use the /home homes command as follows:", "/home homes \"player name|id\" - Shows you a list of all homes from the player."
}
)
}
, {
"SyntaxCommandListHomes", string.Join(NewLine, new[] {
"A Syntax Error Occurred!", "You can only use the /home list command as follows:", "/home list - Shows you a list of all your saved home locations."
}
)
}
, {
"SyntaxCommandTPR", string.Join(NewLine, new[] {
"A Syntax Error Occurred!", "You can only use the /tpr command as follows:", "/tpr \"player name\" - Sends out a teleport request to 'player name'."
}
)
}
, {
"SyntaxCommandTPA", string.Join(NewLine, new[] {
"A Syntax Error Occurred!", "You can only use the /tpa command as follows:", "/tpa - Accepts an incoming teleport request."
}
)
}
, {
"SyntaxCommandTPC", string.Join(NewLine, new[] {
"A Syntax Error Occurred!", "You can only use the /tpc command as follows:", "/tpc - Cancels an teleport request."
}
)
}
, {
"SyntaxConsoleCommandToPos", string.Join(NewLine, new[] {
"A Syntax Error Occurred!", "You can only use the teleport.topos console command as follows:", " > teleport.topos \"player\" x y z"
}
)
}
, {
"SyntaxConsoleCommandToPlayer", string.Join(NewLine, new[] {
"A Syntax Error Occurred!", "You can only use the teleport.toplayer console command as follows:", " > teleport.toplayer \"player\" \"target player\""
}
)
}
, {
"LogTeleport", "{0} teleported to {1}."
}
, {
"LogTeleportPlayer", "{0} teleported {1} to {2}."
}
, {
"LogTeleportBack", "{0} teleported back to previous location."
}
}
, this);
}
private void Loaded() {
Config.Settings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
Config.Settings.Converters = new JsonConverter[] {
new UnityVector3Converter()
}
;
try {
configData = Config.ReadObject<ConfigData>();
}
catch (Exception) {
Puts("Corrupt config, loading default...");
LoadDefaultConfig();
}
if (!(configData.Version == Version)) {
if (configData.Home.VIPHomesLimits == null) {
configData.Home.VIPHomesLimits = new Dictionary<string, int> {
{
ConfigDefaultPermVip, 5
}
}
;
configData.Home.VIPDailyLimits = new Dictionary<string, int> {
// ... [Code preview truncated due to length. Full source in attached file] ...