Exemple #1
0
        public void TeleportPlayerToPoint(Player InPlayer, int PointType)
        {
            string[] point = new string[2];

            if (PointType == LOBBY)
            {
                if (lobbyPoint != "0,0")
                {
                    point = lobbyPoint.Split(',');
                    InPlayer.Teleport(float.Parse(point[0]) * 16, float.Parse(point[1]) * 16);
                }
            }

            else if (PointType == VALIDATED)
            {
                if (validatedPoint != "0,0")
                {
                    point = validatedPoint.Split(',');
                    InPlayer.Teleport(float.Parse(point[0]) * 16, float.Parse(point[1]) * 16);
                }
            }
        }
Exemple #2
0
 public static void TeleportToHouse(string PlayerName, string HouseName, Player Teleporter)
 {
     int playerIndex = House.plugin.GetPlayerHouseIndex(PlayerName);
     if (playerIndex < 0)
     {
         Teleporter.sendMessage("Invalid player", House.plugin.chatColor);
     }
     else
     {
         if (House.plugin.properties.PlayersCanTeleport || Teleporter.Op)
         {
             int houseIndex = House.plugin.GetHouseCoordsIndexByName(PlayerName, HouseName);
             if (houseIndex < 0)
             {
                 if (PlayerName == Teleporter.Name)
                     Teleporter.sendMessage("You don't have a house called " + HouseName, House.plugin.chatColor);
                 else
                     Teleporter.sendMessage(PlayerName + " doesn't have a house called " + HouseName, House.plugin.chatColor);
             }
             else
             {
                 Teleporter.sendMessage("Teleporting to " + HouseName, House.plugin.chatColor);
                 PlayerHouseCoords pHC = House.plugin.playerHouses[House.plugin.GetPlayerHouseIndex(PlayerName)].Houses[houseIndex];
                 if (pHC.TeleportPoint.X > 0 && pHC.TeleportPoint.Y > 0)
                     Teleporter.Teleport(pHC.TeleportPoint.X * 16, pHC.TeleportPoint.Y * 16);
                 else
                     Teleporter.Teleport(((pHC.TopLeft.X * 16) + (pHC.BottomRight.X * 16)) / 2,
                                           ((pHC.TopLeft.Y * 16) + (pHC.BottomRight.Y * 16)) / 2);
             }
         }
         else
             Teleporter.sendMessage("Only OPs can teleport to houses", House.plugin.chatColor);
     }
 }