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 Tutorials
[NEW COMMAND - PLUS] Pickup Item
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="Pollak" data-source="post: 462767" data-attributes="member: 77990"><p style="text-align: center">Hi! I've released a command to pickup all items on the room where this item is the same item the user clicked.</p> <p style="text-align: center">e.g: I have 1000 thrones in the room but i only want remove all thrones (without use the command pickall), so i click 2x on the throne and remove all the thrones that I own..</p> <p style="text-align: center">Any ideia or bug just comment, thanks'! <img src="/styles/default/xenforo/smilies/emojione/smile.png" class="smilie" loading="lazy" alt=":)" title="Smile :)" data-shortname=":)" /></p> <p style="text-align: center">PS: I will not make a tutorial step a step, just share the code so if you understand how add shouldn't be difficult.</p> <p style="text-align: center"></p> <p style="text-align: center"><strong>Habbo.cs</strong>:</p><p>[CODE] public bool PickupItemsStatus = false;</p><p>[/CODE]</p><p></p><p style="text-align: center"><strong>New command (PickupItemsCommand.cs):</strong></p><p>[CODE]#region</p><p>using Plus.HabboHotel.GameClients;</p><p>#endregion</p><p></p><p>namespace Plus.HabboHotel.Rooms.Chat.Commands.User</p><p>{</p><p> public class PickupItemsCommand : IChatCommand</p><p> {</p><p> public string PermissionRequired => "command_pickup_items";</p><p></p><p> public string Parameters => "";</p><p></p><p> public string Description => "Remove all determined items you click 2x.";</p><p></p><p> public void Execute(GameClient Session, Room Room, string[] Params)</p><p> {</p><p> Session.GetHabbo().PickupItemsStatus = !Session.GetHabbo().PickupItemsStatus;</p><p> Session.SendWhisper(Session.GetHabbo().PickupItemsStatus ? "Enabled! Click 2x on the furniture you want remove. Will be remove all items from the room equals this Item." : "Disabled!", 34);</p><p> }</p><p> }</p><p>}[/CODE]</p><p></p><p style="text-align: center"><strong>CommandManager.cs:</strong></p><p>[CODE] Register("pickupitem", new PickupItemsCommand());</p><p>[/CODE]</p><p style="text-align: center"><strong>UseFurnitureEvent.cs:</strong></p> <p style="text-align: center">maybe after Room User user...</p> <p style="text-align: center"></p><p>[CODE]#region Pickup Items</p><p></p><p> if (Session.GetHabbo().PickupItemsStatus)</p><p> {</p><p> int itemRemove = Item.BaseItem;</p><p> using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())</p><p> foreach (Item item in Room.GetRoomItemHandler().GetFloor.Where(item => item.BaseItem == itemRemove && item.UserID == Session.GetHabbo().Id && item != null))</p><p> {</p><p> dbClient.RunQuery("UPDATE `items` SET `room_id`='0' WHERE `id`= " + item.Id + " LIMIT 1");</p><p></p><p> Room.GetRoomItemHandler().RemoveFurniture(Session, item.Id);</p><p> }</p><p> </p><p> Session.GetHabbo().GetInventoryComponent().UpdateItems(true);</p><p> Session.GetHabbo().PickupItemsStatus = !Session.GetHabbo().PickupItemsStatus;</p><p> return;</p><p> }</p><p></p><p> #endregion[/CODE]</p><p style="text-align: center"><strong>UseWallItemEvent.cs:</strong></p><p>[CODE]#region Pickup Items</p><p></p><p> if (Session.GetHabbo().PickupItemsStatus)</p><p> {</p><p> int itemRemove = Item.BaseItem;</p><p> using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())</p><p> foreach (Item item in Room.GetRoomItemHandler().GetWall.Where(item => item.BaseItem == itemRemove && item.UserID == Session.GetHabbo().Id && item != null))</p><p> {</p><p> dbClient.RunQuery("UPDATE `items` SET `room_id`='0' WHERE `id`= " + item.Id + " LIMIT 1");</p><p></p><p> Room.GetRoomItemHandler().RemoveFurniture(Session, item.Id);</p><p> }</p><p> </p><p> Session.GetHabbo().GetInventoryComponent().UpdateItems(true);</p><p> Session.GetHabbo().PickupItemsStatus = !Session.GetHabbo().PickupItemsStatus;</p><p> return;</p><p> }</p><p></p><p> #endregion[/CODE]</p><p style="text-align: center"></p> <p style="text-align: center"><strong>Execute this query:</strong></p> <p style="text-align: center">[CODE]INSERT INTO `permissions_commands` (`command`, `group_id`, `subscription_id`) VALUES ('command_pickup_items', '1', '0');[/CODE]</p> <p style="text-align: center"></p> <p style="text-align: center">Preview:</p> <p style="text-align: center">[ATTACH=full]11272[/ATTACH]</p> <p style="text-align: center"></p> <p style="text-align: center"><strong>Credits:</strong></p> <p style="text-align: center">Snaiker (Pollak)</p></blockquote><p></p>
[QUOTE="Pollak, post: 462767, member: 77990"] [CENTER]Hi! I've released a command to pickup all items on the room where this item is the same item the user clicked. e.g: I have 1000 thrones in the room but i only want remove all thrones (without use the command pickall), so i click 2x on the throne and remove all the thrones that I own.. Any ideia or bug just comment, thanks'! :) PS: I will not make a tutorial step a step, just share the code so if you understand how add shouldn't be difficult. [B]Habbo.cs[/B]:[/CENTER] [CODE] public bool PickupItemsStatus = false; [/CODE] [CENTER][B]New command (PickupItemsCommand.cs):[/B][/CENTER] [CODE]#region using Plus.HabboHotel.GameClients; #endregion namespace Plus.HabboHotel.Rooms.Chat.Commands.User { public class PickupItemsCommand : IChatCommand { public string PermissionRequired => "command_pickup_items"; public string Parameters => ""; public string Description => "Remove all determined items you click 2x."; public void Execute(GameClient Session, Room Room, string[] Params) { Session.GetHabbo().PickupItemsStatus = !Session.GetHabbo().PickupItemsStatus; Session.SendWhisper(Session.GetHabbo().PickupItemsStatus ? "Enabled! Click 2x on the furniture you want remove. Will be remove all items from the room equals this Item." : "Disabled!", 34); } } }[/CODE] [CENTER][B]CommandManager.cs:[/B][/CENTER] [CODE] Register("pickupitem", new PickupItemsCommand()); [/CODE] [CENTER][B]UseFurnitureEvent.cs:[/B] maybe after Room User user... [/CENTER] [CODE]#region Pickup Items if (Session.GetHabbo().PickupItemsStatus) { int itemRemove = Item.BaseItem; using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) foreach (Item item in Room.GetRoomItemHandler().GetFloor.Where(item => item.BaseItem == itemRemove && item.UserID == Session.GetHabbo().Id && item != null)) { dbClient.RunQuery("UPDATE `items` SET `room_id`='0' WHERE `id`= " + item.Id + " LIMIT 1"); Room.GetRoomItemHandler().RemoveFurniture(Session, item.Id); } Session.GetHabbo().GetInventoryComponent().UpdateItems(true); Session.GetHabbo().PickupItemsStatus = !Session.GetHabbo().PickupItemsStatus; return; } #endregion[/CODE] [CENTER][B]UseWallItemEvent.cs:[/B][/CENTER] [CODE]#region Pickup Items if (Session.GetHabbo().PickupItemsStatus) { int itemRemove = Item.BaseItem; using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) foreach (Item item in Room.GetRoomItemHandler().GetWall.Where(item => item.BaseItem == itemRemove && item.UserID == Session.GetHabbo().Id && item != null)) { dbClient.RunQuery("UPDATE `items` SET `room_id`='0' WHERE `id`= " + item.Id + " LIMIT 1"); Room.GetRoomItemHandler().RemoveFurniture(Session, item.Id); } Session.GetHabbo().GetInventoryComponent().UpdateItems(true); Session.GetHabbo().PickupItemsStatus = !Session.GetHabbo().PickupItemsStatus; return; } #endregion[/CODE] [CENTER] [B]Execute this query:[/B] [CODE]INSERT INTO `permissions_commands` (`command`, `group_id`, `subscription_id`) VALUES ('command_pickup_items', '1', '0');[/CODE] Preview: [ATTACH=full]11272[/ATTACH] [B]Credits:[/B] Snaiker (Pollak)[/CENTER] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Tutorials
[NEW COMMAND - PLUS] Pickup Item
Top