Quantcast
Channel: RaGEZONE - MMO Development Forums
Viewing all articles
Browse latest Browse all 30179

PlusEMU :sellroom command fix?

$
0
0
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 '')");


}

Viewing all articles
Browse latest Browse all 30179

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>