PlusEMU :sellroom command fix?

Results 1 to 8 of 8
  1. #1
    Proficient Member Kristophers is offline
    MemberRank
    Dec 2013 Join Date
    198Posts

    PlusEMU :sellroom command fix?

    Okay so I've explored commands in the emulator and saw it has buy room and sell room. I seen that it works h room or disconnects you when you buy or sell the room or when you type sell room in a room thats not yours.
    Code:

    Spoiler:

    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");
    }


    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!\n\n" +
    "You can cancel selling a room by typing ':buyroom 0' (Without '')");


    }


  2. #2
    DO YOU HAVE THE POWER? Power is offline
    MemberRank
    Aug 2012 Join Date
    Haverhill, SuffLocation
    248Posts

    Re: PlusEMU :sellroom command fix?

    Quote Originally Posted by Kristophers View Post
    Okay so I've explored commands in the emulator and saw it has buy room and sell room. I seen that it works h room or disconnects you when you buy or sell the room or when you type sell room in a room thats not yours.
    Code:

    Spoiler:

    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");
    }


    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!\n\n" +
    "You can cancel selling a room by typing ':buyroom 0' (Without '')");


    }
    i released a sellroom and buyroom command for swift emu but never released the edit to furni tables to make the furni transfer to the new owner i cant even fully remember how i did i think i changed all the placeby to room owners instead of session

    but anyway
    http://forum.ragezone.com/f353/bc-st...llroom-937609/

    may have to clean the code up but they both work :P just got to work out the furni for your self

  3. #3
    Proficient Member Kristophers is offline
    MemberRank
    Dec 2013 Join Date
    198Posts

    Re: PlusEMU :sellroom command fix?

    Quote Originally Posted by Power69 View Post
    i released a sellroom and buyroom command for swift emu but never released the edit to furni tables to make the furni transfer to the new owner i cant even fully remember how i did i think i changed all the placeby to room owners instead of session

    but anyway
    http://forum.ragezone.com/f353/bc-st...llroom-937609/

    may have to clean the code up but they both work :P just got to work out the furni for your self
    Take a look at the code I've put. It works with furniture. Just cannot have a group on room. Could you make it where it don't disconnect you? Just sends you to hotel view

  4. #4
    Member Fadehotel is offline
    MemberRank
    Aug 2011 Join Date
    66Posts

    Re: PlusEMU :sellroom command fix?

    -bump

  5. #5
    DO YOU HAVE THE POWER? Power is offline
    MemberRank
    Aug 2012 Join Date
    Haverhill, SuffLocation
    248Posts

    Re: PlusEMU :sellroom command fix?

    Quote Originally Posted by Kristophers View Post
    Take a look at the code I've put. It works with furniture. Just cannot have a group on room. Could you make it where it don't disconnect you? Just sends you to hotel view
    i dont see a if statement for if not room owner
    and i dont see why it shouldnt d.c you

  6. #6
    Proficient Member Kristophers is offline
    MemberRank
    Dec 2013 Join Date
    198Posts

    Re: PlusEMU :sellroom command fix?

    Quote Originally Posted by Power69 View Post
    i dont see a if statement for if not room owner
    and i dont see why it shouldnt d.c you
    Do you use plus? Would you beable to test? If not I have a Live hotel using this.

  7. #7
    Account Upgraded | Title Enabled! Chapo is offline
    MemberRank
    Jul 2010 Join Date
    United StatesLocation
    944Posts

    Re: PlusEMU :sellroom command fix?

    Try this (don't know there is different between yours).

    #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
    If this not work try using breaks and find out yourself whats wrong.

  8. #8
    Proficient Member Kristophers is offline
    MemberRank
    Dec 2013 Join Date
    198Posts

    Re: PlusEMU :sellroom command fix?

    Quote Originally Posted by Ryan View Post
    Try this (don't know there is different between yours).



    If this not work try using breaks and find out yourself whats wrong.
    The command works. It just disconnects you. Im not sure because it needs to reload the furniture to another user or what.



Advertisement