Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
SellRoomCommand.cs
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="jadexxz" data-source="post: 461673" data-attributes="member: 94095"><p>Hello guys, the :sellroom command works good, but when I do sell a room, the notification that "This room is for sale, type :buyroom to buy it for 3 diamonds" message shows up only to the seller. The other people in the room cannot see it!</p><p></p><p>Entire code:</p><p>[CODE]using Slopt.Communication.Packets.Outgoing.Rooms.Notifications;</p><p>using Slopt.Database.Interfaces;</p><p>using Slopt.HabboHotel.GameClients;</p><p></p><p>namespace Slopt.HabboHotel.Rooms.Chat.Commands.User</p><p>{</p><p> class SellRoomCommand : IChatCommand</p><p> {</p><p> public string Description</p><p> {</p><p> get { return "Odanızı satışa çıkarabilir, para karşılığında satabilirsiniz."; }</p><p> }</p><p></p><p> public string Parameters</p><p> {</p><p> get { return "%fiyat%"; }</p><p> }</p><p></p><p> public string PermissionRequired</p><p> {</p><p> get { return "command_sell_room"; }</p><p> }</p><p></p><p></p><p> public void Execute(GameClient Session, Room Room, string[] Params)</p><p> {</p><p> if (Params.Length == 1)</p><p> {</p><p> Session.SendWhisper("Bir fiyat koy (Elmas olarak).", 34);</p><p> return;</p><p> }</p><p></p><p> if (!Room.CheckRights(Session, true))</p><p> return;</p><p></p><p> if (Room == null)</p><p></p><p> if (Params.Length == 1)</p><p> {</p><p> Session.SendWhisper("Hata! bir fiyat giriniz.", 34);</p><p> return;</p><p> }</p><p> else if (Room.Group != null)</p><p> {</p><p> Session.SendWhisper("Bu odada grup bulunduÄŸundan odayı satamazsın, grubu kaldırıp öyle dene.", 34);</p><p> return;</p><p> }</p><p></p><p> int Value = 0;</p><p> if (!int.TryParse(Params[1], out Value))</p><p> {</p><p> Session.SendWhisper("DoÄŸru elmas bir deÄŸeri girmediniz.", 34);</p><p> return;</p><p> }</p><p></p><p> if (Value < 0)</p><p> {</p><p> Session.SendWhisper("Negatif sayısal deÄŸere sahip bir fiyat konulamaz.", 34);</p><p> return;</p><p> }</p><p></p><p> if (Room.ForSale)</p><p> {</p><p> Room.SalePrice = Value;</p><p> }</p><p> else</p><p> {</p><p> Room.ForSale = true;</p><p> Room.SalePrice = Value;</p><p> }</p><p></p><p> foreach (RoomUser User in Room.GetRoomUserManager().GetRoomUsers())</p><p> {</p><p> if (User == null || User.GetClient() == null)</p><p> continue;</p><p></p><p> Session.SendWhisper("Bu oda " + Value + " elmas deÄŸerinde satılıyor. Satın almak için \":odaal\" yazın.", 34);</p><p> }</p><p></p><p> Session.SendNotification("Odanızı " + Value + " elmas deÄŸerinde satılığa çıkardınız.\n\nAklınızda olsun: Satılan odalar geri alınamaz.\n\n" +</p><p> "Bu odanın satışını \":bosalt\" komutuyla durdurabilirsin.");</p><p></p><p> return;</p><p> }</p><p> }</p><p>}[/CODE]</p><p></p><p>And the message:</p><p>[CODE] foreach (RoomUser User in Room.GetRoomUserManager().GetRoomUsers())</p><p></p><p> {</p><p></p><p> if (User == null || User.GetClient() == null)</p><p></p><p> continue;</p><p></p><p></p><p></p><p> Session.SendWhisper("Bu oda " + Value + " elmas deÄŸerinde satılıyor. Satın almak için \":odaal\" yazın.", 34);</p><p></p><p> }[/CODE]</p><p>Help! How can I make the message that will be show to everyone in the room!</p></blockquote><p></p>
[QUOTE="jadexxz, post: 461673, member: 94095"] Hello guys, the :sellroom command works good, but when I do sell a room, the notification that "This room is for sale, type :buyroom to buy it for 3 diamonds" message shows up only to the seller. The other people in the room cannot see it! Entire code: [CODE]using Slopt.Communication.Packets.Outgoing.Rooms.Notifications; using Slopt.Database.Interfaces; using Slopt.HabboHotel.GameClients; namespace Slopt.HabboHotel.Rooms.Chat.Commands.User { class SellRoomCommand : IChatCommand { public string Description { get { return "Odanızı satışa çıkarabilir, para karşılığında satabilirsiniz."; } } public string Parameters { get { return "%fiyat%"; } } public string PermissionRequired { get { return "command_sell_room"; } } public void Execute(GameClient Session, Room Room, string[] Params) { if (Params.Length == 1) { Session.SendWhisper("Bir fiyat koy (Elmas olarak).", 34); return; } if (!Room.CheckRights(Session, true)) return; if (Room == null) if (Params.Length == 1) { Session.SendWhisper("Hata! bir fiyat giriniz.", 34); return; } else if (Room.Group != null) { Session.SendWhisper("Bu odada grup bulunduÄŸundan odayı satamazsın, grubu kaldırıp öyle dene.", 34); return; } int Value = 0; if (!int.TryParse(Params[1], out Value)) { Session.SendWhisper("DoÄŸru elmas bir deÄŸeri girmediniz.", 34); return; } if (Value < 0) { Session.SendWhisper("Negatif sayısal deÄŸere sahip bir fiyat konulamaz.", 34); return; } if (Room.ForSale) { Room.SalePrice = Value; } else { Room.ForSale = true; Room.SalePrice = Value; } foreach (RoomUser User in Room.GetRoomUserManager().GetRoomUsers()) { if (User == null || User.GetClient() == null) continue; Session.SendWhisper("Bu oda " + Value + " elmas deÄŸerinde satılıyor. Satın almak için \":odaal\" yazın.", 34); } Session.SendNotification("Odanızı " + Value + " elmas deÄŸerinde satılığa çıkardınız.\n\nAklınızda olsun: Satılan odalar geri alınamaz.\n\n" + "Bu odanın satışını \":bosalt\" komutuyla durdurabilirsin."); return; } } }[/CODE] And the message: [CODE] foreach (RoomUser User in Room.GetRoomUserManager().GetRoomUsers()) { if (User == null || User.GetClient() == null) continue; Session.SendWhisper("Bu oda " + Value + " elmas deÄŸerinde satılıyor. Satın almak için \":odaal\" yazın.", 34); }[/CODE] Help! How can I make the message that will be show to everyone in the room! [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
SellRoomCommand.cs
Top