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
[PlusEMU] Trouble Getting :emptyitems To Not Delete LTD's
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="treebeard" data-source="post: 431083" data-attributes="member: 79259"><p>Helllo everyone,</p><p></p><p>I'm currently trying to get the command :emptyitems to not delete LTD's.</p><p>I have edited the function ClearItems() in InventoryComponent.cs to look like this:</p><p>[CODE]public void ClearItems()</p><p> {</p><p> UpdateItems(true);</p><p></p><p> using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())</p><p> {</p><p> dbClient.RunQuery("DELETE FROM items WHERE room_id='0' AND limited_stack = '0' AND user_id = " + _userId); //Do join</p><p> }</p><p></p><p> this._floorItems.Clear();</p><p> this._wallItems.Clear();</p><p></p><p> if (_client != null)</p><p> _client.SendPacket(new FurniListUpdateComposer());</p><p> }</p><p>[/CODE]</p><p></p><p>This actually does work but not in a very nice way. What happens is the users inventory would be completely cleared until they logged out and back in, then the LTD's would appear in inventory again. I want it to just never show that the LTD's are deleted.</p><p></p><p>This is just a cheap fix I'm trying to implement till I can figure out how to get deleted LTD's to transfer to an account for re-use.</p><p></p><p>Any help is appreciated, thanks!</p><p></p><p>Edit: I realized I didn't include the actual code for emptyitems in case that helps.</p><p></p><p></p><p>[CODE]using System;</p><p>using System.Linq;</p><p>using System.Text;</p><p>using System.Collections.Generic;</p><p>using Plus.Communication.Packets.Outgoing.Inventory.Furni;</p><p></p><p>namespace Plus.HabboHotel.Rooms.Chat.Commands.User</p><p>{</p><p> class EmptyItems : IChatCommand</p><p> {</p><p> public string PermissionRequired</p><p> {</p><p> get { return "command_empty_items"; }</p><p> }</p><p></p><p> public string Parameters</p><p> {</p><p> get { return "%yes%"; }</p><p> }</p><p></p><p> public string Description</p><p> {</p><p> get { return "Is your inventory full? You can remove all items by typing this command."; }</p><p> }</p><p></p><p> public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)</p><p> {</p><p> if (Params.Length == 1)</p><p> {</p><p> Session.SendNotification("Are you sure you want to clear your inventory? You will lose all the furniture!\n" +</p><p> "To confirm, type \":emptyitems yes\". \n\nOnce you do this, there is no going back!\n(If you do not want to empty it, just ignore this message!)\n\n" +</p><p> "PLEASE NOTE! If you have more than 3000 items, the hidden items will also be DELETED.");</p><p> return;</p><p> }</p><p> else</p><p> {</p><p> if (Params.Length == 2 && Params[1].ToString() == "yes")</p><p> {</p><p> Session.GetHabbo().GetInventoryComponent().ClearItems();</p><p> Session.SendNotification("Your inventory has been cleared!"); </p><p> return;</p><p> }</p><p> else if (Params.Length == 2 && Params[1].ToString() != "yes")</p><p> {</p><p> Session.SendNotification("To confirm, you must type in :emptyitems yes");</p><p> return;</p><p> }</p><p> }</p><p> }</p><p> }</p><p>}</p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="treebeard, post: 431083, member: 79259"] Helllo everyone, I'm currently trying to get the command :emptyitems to not delete LTD's. I have edited the function ClearItems() in InventoryComponent.cs to look like this: [CODE]public void ClearItems() { UpdateItems(true); using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.RunQuery("DELETE FROM items WHERE room_id='0' AND limited_stack = '0' AND user_id = " + _userId); //Do join } this._floorItems.Clear(); this._wallItems.Clear(); if (_client != null) _client.SendPacket(new FurniListUpdateComposer()); } [/CODE] This actually does work but not in a very nice way. What happens is the users inventory would be completely cleared until they logged out and back in, then the LTD's would appear in inventory again. I want it to just never show that the LTD's are deleted. This is just a cheap fix I'm trying to implement till I can figure out how to get deleted LTD's to transfer to an account for re-use. Any help is appreciated, thanks! Edit: I realized I didn't include the actual code for emptyitems in case that helps. [CODE]using System; using System.Linq; using System.Text; using System.Collections.Generic; using Plus.Communication.Packets.Outgoing.Inventory.Furni; namespace Plus.HabboHotel.Rooms.Chat.Commands.User { class EmptyItems : IChatCommand { public string PermissionRequired { get { return "command_empty_items"; } } public string Parameters { get { return "%yes%"; } } public string Description { get { return "Is your inventory full? You can remove all items by typing this command."; } } public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { if (Params.Length == 1) { Session.SendNotification("Are you sure you want to clear your inventory? You will lose all the furniture!\n" + "To confirm, type \":emptyitems yes\". \n\nOnce you do this, there is no going back!\n(If you do not want to empty it, just ignore this message!)\n\n" + "PLEASE NOTE! If you have more than 3000 items, the hidden items will also be DELETED."); return; } else { if (Params.Length == 2 && Params[1].ToString() == "yes") { Session.GetHabbo().GetInventoryComponent().ClearItems(); Session.SendNotification("Your inventory has been cleared!"); return; } else if (Params.Length == 2 && Params[1].ToString() != "yes") { Session.SendNotification("To confirm, you must type in :emptyitems yes"); return; } } } } } [/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
[PlusEMU] Trouble Getting :emptyitems To Not Delete LTD's
Top