Beispiel #1
0
        public void CMD_HouseType(Client player, int new_type)
        {
            int RightsLevel = PlayerFunctions.Player.GetRightsLevel(player);

            if (RightsLevel < 9)
            {
                player.sendChatMessage("~r~ERROR: ~w~Эта команда вам недоступна.");
                return;
            }

            if (!player.hasData("HouseMarker_ID"))
            {
                player.sendChatMessage("~r~ERROR: ~w~Встаньте на маркер дома который хотите изменить.");
                return;
            }

            if (new_type < 0 || new_type >= HouseTypes.HouseTypeList.Count)
            {
                player.sendChatMessage("~r~ERROR: ~w~Неверный класс дома.");
                return;
            }

            House house = Main.Houses.FirstOrDefault(h => h.ID == player.getData("HouseMarker_ID"));

            if (house == null)
            {
                return;
            }

            house.SetType(new_type);
            player.sendChatMessage(string.Format("~b~HOUSE SCRIPT: ~w~Класс дома изменён на ~y~{0}.", HouseTypes.HouseTypeList[new_type].Name));
        }
        public void CMD_HouseType(Client player, int new_type)
        {
            if (API.getPlayerAclGroup(player) != "Admin")
            {
                player.sendChatMessage("~r~ERROR: ~w~Only admins can use this command.");
                return;
            }

            if (!player.hasData("HouseMarker_ID"))
            {
                player.sendChatMessage("~r~ERROR: ~w~Stand in the entrance marker of the house you want to edit.");
                return;
            }

            if (new_type < 0 || new_type >= HouseTypes.HouseTypeList.Count)
            {
                player.sendChatMessage("~r~ERROR: ~w~Invalid type ID.");
                return;
            }

            House house = Main.Houses.FirstOrDefault(h => h.ID == player.getData("HouseMarker_ID"));

            if (house == null)
            {
                return;
            }

            house.SetType(new_type);
            player.sendChatMessage(string.Format("~b~HOUSE SCRIPT: ~w~House type set to ~y~{0}.", HouseTypes.HouseTypeList[new_type].Name));
        }