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="JayC" data-source="post: 431084" data-attributes="member: 36373"><p>[CODE]this._floorItems.Clear();[/CODE]</p><p></p><p>That empties the array of floor items inside the users inventories.</p><p>[doublepost=1521861051,1521859870][/doublepost]Update, Here is your Solution:</p><p></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)</p><p> }</p><p></p><p> this.removeItemsExceptLimited();</p><p> this._wallItems.Clear();</p><p></p><p> if (_client != null)</p><p> _client.SendMessage(new FurniListUpdateComposer());</p><p> }</p><p></p><p> private void removeItemsExceptLimited()</p><p> {</p><p> Item itemRemoved;</p><p></p><p> foreach (var item in this._floorItems)</p><p> if (item.Value.LimitedNo == 0)</p><p> this._floorItems.TryRemove(item.Key, out itemRemoved);</p><p> }[/CODE]</p></blockquote><p></p>
[QUOTE="JayC, post: 431084, member: 36373"] [CODE]this._floorItems.Clear();[/CODE] That empties the array of floor items inside the users inventories. [doublepost=1521861051,1521859870][/doublepost]Update, Here is your Solution: [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) } this.removeItemsExceptLimited(); this._wallItems.Clear(); if (_client != null) _client.SendMessage(new FurniListUpdateComposer()); } private void removeItemsExceptLimited() { Item itemRemoved; foreach (var item in this._floorItems) if (item.Value.LimitedNo == 0) this._floorItems.TryRemove(item.Key, out itemRemoved); }[/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