public void Home(Player source, string[] arguments) { if (PluginGlobals.Homes.ContainsKey(source)) { PlayerLocation pos = null; PluginGlobals.Homes.TryGetValue(source, out pos); if (pos != null) { source.SendMessage("[SetHome] Teleporting you to your home!"); source.KnownPosition = pos; source.SendMovePlayer(); } else { source.SendMessage("[SetHome] Something went wrong!"); } } else { source.SendMessage("[SetHome] You don't have a home set!"); source.SendMessage("[SetHome] Set a home with \"/sethome\" first!"); } }
public void Teleport(Player player, int x, int y, int z) { // send teleport to spawn player.KnownPosition = new PlayerLocation { X = x, Y = y, Z = z, Yaw = 91, Pitch = 28, HeadYaw = 91 }; player.SendMovePlayer(); player.Level.BroadcastTextMessage(string.Format("{0} teleported to coordinates {1},{2},{3}.", player.Username, x, y, z), type: MessageType.Raw); }