#region Sell Room (:sellroom)
case "sellroom":
{
if (Session.GetHabbo().HasCmd("sellroom"))
{
Room Room = Session.GetHabbo().CurrentRoom;
Int32 Value = 0;
if (Room == null)
return true;
if (!Room.CheckRights(Session, true))
return true;
if (Params.Length == 1)
{
Session.SendNotif("In order to sell a room, you must include a value. \n\nPLEASE NOTE:\nIf you sell a room you CANNOT get any of it back!");
return true;
}
else if (Room.Group != null)
{
Session.SendNotif("You cannot sell a room with a group on it.\n Delete the group first by typing :deletegroup");
return true;
}
else if (!SilverwaveEnvironment.IsNum(Params[1]))
{
SendChatMessage(Session, "You must enter a number!");
return true;
}
else
Value = Convert.ToInt32(Params[1]);
if (Value < 0)
{
SendChatMessage(Session, "You can not sell a room for less than 0 credits!");
return true;
}
if (Room.ForSale)
{
Room.SalePrice = Value;
}
else
{
Room.ForSale = true;
Room.SalePrice = Value;
}
foreach (RoomUser User in Room.GetRoomUserManager().GetRoomUsers())
{
User.SendChatMsg("This room is for sale! The current asking price is " + Value + " credits! Buy it by saying :buyroom");
}
}
return true;
}
#endregion