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
Diamond Exchange won't work [PLUSEMU]
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="Tex18" data-source="post: 389596" data-attributes="member: 72282"><p>Hi Devbest!</p><p>So recently I added diamond exchange to my hotel using a code found here on Devbest, but the problem is that no redeemable furni really exchanged, it won't even exchange if I use a swf named DFD_ or if I change the name in the furniture table in my database, it just shows a popup with: This exchange is worth 410 Credits and when I click on Redeem it just stays in the room and nothing happens.</p><p></p><p>The following codes did I use:</p><p><strong>ItemUtility.cs</strong></p><p>[CODE]using System;</p><p>using System.Linq;</p><p>using System.Text;</p><p>using System.Collections.Generic;</p><p></p><p>using Plus.HabboHotel.Items;</p><p>using Plus.HabboHotel.Items.Utilities;</p><p></p><p>namespace Plus.HabboHotel.Catalog.Utilities</p><p>{</p><p> public static class ItemUtility</p><p> {</p><p> public static bool CanGiftItem(CatalogItem Item)</p><p> {</p><p> if (!Item.Data.AllowGift || Item.IsLimited || Item.Amount > 1 || Item.Data.ItemName.ToLower().StartsWith("cf_") || Item.Data.ItemName.ToLower().StartsWith("cfc_") || Item.Data.ItemName.ToLower().StartsWith("dfd_") ||</p><p> Item.Data.InteractionType == InteractionType.BADGE || (Item.Data.Type != 's' && Item.Data.Type != 'i') || Item.CostDiamonds > 0 ||</p><p> Item.Data.InteractionType == InteractionType.TELEPORT || Item.Data.InteractionType == InteractionType.DEAL)</p><p> return false;</p><p></p><p></p><p> if (Item.Data.IsRare)</p><p> return false;</p><p></p><p></p><p> if (PetUtility.IsPet(Item.Data.InteractionType))</p><p> return false;</p><p> return true;</p><p> }</p><p></p><p></p><p> public static bool CanSelectAmount(CatalogItem Item)</p><p> {</p><p> if (Item.IsLimited || Item.Amount > 1 || Item.Data.ItemName.ToLower().StartsWith("cf_") || Item.Data.ItemName.ToLower().StartsWith("cfc_") || Item.Data.ItemName.ToLower().StartsWith("dfd_") || !Item.HaveOffer || Item.Data.InteractionType == InteractionType.BADGE || Item.Data.InteractionType == InteractionType.DEAL)</p><p> return false;</p><p> return true;</p><p> }</p><p></p><p> public static int GetSaddleId(int Saddle)</p><p> {</p><p> switch (Saddle)</p><p> {</p><p> default:</p><p> case 9:</p><p> return 7100; //4221 Changed to the right BaseItem, so it can be saved.</p><p> case 10:</p><p> return 4450;</p><p> }</p><p> }</p><p></p><p> public static bool IsRare(Item Item)</p><p> {</p><p> if (Item.LimitedNo > 0)</p><p> return true;</p><p></p><p> if (Item.Data.IsRare)</p><p> return true;</p><p></p><p> return false;</p><p> }</p><p> }</p><p>}</p><p>[/CODE]</p><p></p><p>And:</p><p></p><p><strong>CreditFurniRedeemEvents.cs</strong></p><p>[CODE]using System;</p><p>using System.Linq;</p><p>using System.Text;</p><p>using System.Collections.Generic;</p><p></p><p>using Plus.HabboHotel.Rooms;</p><p>using Plus.HabboHotel.Items;</p><p>using Plus.Communication.Packets.Outgoing.Inventory.Purse;</p><p>using Plus.Communication.Packets.Outgoing.Inventory.Furni;</p><p></p><p>using Plus.Database.Interfaces;</p><p></p><p></p><p>namespace Plus.Communication.Packets.Incoming.Rooms.Furni</p><p>{</p><p> class CreditFurniRedeemEvent : IPacketEvent</p><p> {</p><p> public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)</p><p> {</p><p> if (!Session.GetHabbo().InRoom)</p><p> return;</p><p></p><p></p><p> Room Room;</p><p></p><p></p><p> if (!PlusEnvironment.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out Room))</p><p> return;</p><p></p><p></p><p> if (!Room.CheckRights(Session, true))</p><p> return;</p><p></p><p></p><p> if (PlusEnvironment.GetDBConfig().DBData["exchange_enabled"] != "1")</p><p> {</p><p> Session.SendNotification("The hotel managers have temporarilly disabled exchanging!");</p><p> return;</p><p> }</p><p></p><p></p><p> Item Exchange = Room.GetRoomItemHandler().GetItem(Packet.PopInt());</p><p> if (Exchange == null)</p><p> return;</p><p></p><p></p><p> if (!Exchange.GetBaseItem().ItemName.StartsWith("CF_") && !Exchange.GetBaseItem().ItemName.StartsWith("CFC_") || !Exchange.GetBaseItem().ItemName.StartsWith("DFD_"))</p><p> return;</p><p></p><p></p><p> string[] Split = Exchange.GetBaseItem().ItemName.Split('_');</p><p> int Value = int.Parse(Split[1]);</p><p></p><p></p><p> if (Value > 0)</p><p> {</p><p> switch (Split[0])</p><p> { // Checks what type of exchange furni we're dealing with</p><p> default:</p><p> {</p><p> Session.GetHabbo().Credits += Value;</p><p> Session.SendMessage(new CreditBalanceComposer(Session.GetHabbo().Credits));</p><p></p><p> break;</p><p> }</p><p> case "DFD": // Updates a users diamonds instead of credits.</p><p> {</p><p> Session.GetHabbo().Diamonds += Value;</p><p> Session.SendMessage(new HabboActivityPointNotificationComposer(Session.GetHabbo().Diamonds, 0, 5));</p><p></p><p> break;</p><p> }</p><p> }</p><p> }</p><p></p><p></p><p> using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())</p><p> {</p><p> dbClient.RunQuery("DELETE FROM `items` WHERE `id` = '" + Exchange.Id + "' LIMIT 1");</p><p> }</p><p></p><p></p><p> Session.SendMessage(new FurniListUpdateComposer());</p><p> Room.GetRoomItemHandler().RemoveFurniture(null, Exchange.Id, false);</p><p> Session.GetHabbo().GetInventoryComponent().RemoveItem(Exchange.Id);</p><p> }</p><p> }</p><p>}</p><p>[/CODE]</p><p></p><p><strong>I tried it with a normal diamond exchange swf file named: CFC_belcrbar_500 and a renamed DFD_belcrbar_500 and both had the same problem in plusEMU </strong></p><p><strong></strong></p><p><strong>Thank you very very much for helping me out, </strong></p><p><strong></strong></p><p><strong>Tex18</strong></p></blockquote><p></p>
[QUOTE="Tex18, post: 389596, member: 72282"] Hi Devbest! So recently I added diamond exchange to my hotel using a code found here on Devbest, but the problem is that no redeemable furni really exchanged, it won't even exchange if I use a swf named DFD_ or if I change the name in the furniture table in my database, it just shows a popup with: This exchange is worth 410 Credits and when I click on Redeem it just stays in the room and nothing happens. The following codes did I use: [B]ItemUtility.cs[/B] [CODE]using System; using System.Linq; using System.Text; using System.Collections.Generic; using Plus.HabboHotel.Items; using Plus.HabboHotel.Items.Utilities; namespace Plus.HabboHotel.Catalog.Utilities { public static class ItemUtility { public static bool CanGiftItem(CatalogItem Item) { if (!Item.Data.AllowGift || Item.IsLimited || Item.Amount > 1 || Item.Data.ItemName.ToLower().StartsWith("cf_") || Item.Data.ItemName.ToLower().StartsWith("cfc_") || Item.Data.ItemName.ToLower().StartsWith("dfd_") || Item.Data.InteractionType == InteractionType.BADGE || (Item.Data.Type != 's' && Item.Data.Type != 'i') || Item.CostDiamonds > 0 || Item.Data.InteractionType == InteractionType.TELEPORT || Item.Data.InteractionType == InteractionType.DEAL) return false; if (Item.Data.IsRare) return false; if (PetUtility.IsPet(Item.Data.InteractionType)) return false; return true; } public static bool CanSelectAmount(CatalogItem Item) { if (Item.IsLimited || Item.Amount > 1 || Item.Data.ItemName.ToLower().StartsWith("cf_") || Item.Data.ItemName.ToLower().StartsWith("cfc_") || Item.Data.ItemName.ToLower().StartsWith("dfd_") || !Item.HaveOffer || Item.Data.InteractionType == InteractionType.BADGE || Item.Data.InteractionType == InteractionType.DEAL) return false; return true; } public static int GetSaddleId(int Saddle) { switch (Saddle) { default: case 9: return 7100; //4221 Changed to the right BaseItem, so it can be saved. case 10: return 4450; } } public static bool IsRare(Item Item) { if (Item.LimitedNo > 0) return true; if (Item.Data.IsRare) return true; return false; } } } [/CODE] And: [B]CreditFurniRedeemEvents.cs[/B] [CODE]using System; using System.Linq; using System.Text; using System.Collections.Generic; using Plus.HabboHotel.Rooms; using Plus.HabboHotel.Items; using Plus.Communication.Packets.Outgoing.Inventory.Purse; using Plus.Communication.Packets.Outgoing.Inventory.Furni; using Plus.Database.Interfaces; namespace Plus.Communication.Packets.Incoming.Rooms.Furni { class CreditFurniRedeemEvent : IPacketEvent { public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { if (!Session.GetHabbo().InRoom) return; Room Room; if (!PlusEnvironment.GetGame().GetRoomManager().TryGetRoom(Session.GetHabbo().CurrentRoomId, out Room)) return; if (!Room.CheckRights(Session, true)) return; if (PlusEnvironment.GetDBConfig().DBData["exchange_enabled"] != "1") { Session.SendNotification("The hotel managers have temporarilly disabled exchanging!"); return; } Item Exchange = Room.GetRoomItemHandler().GetItem(Packet.PopInt()); if (Exchange == null) return; if (!Exchange.GetBaseItem().ItemName.StartsWith("CF_") && !Exchange.GetBaseItem().ItemName.StartsWith("CFC_") || !Exchange.GetBaseItem().ItemName.StartsWith("DFD_")) return; string[] Split = Exchange.GetBaseItem().ItemName.Split('_'); int Value = int.Parse(Split[1]); if (Value > 0) { switch (Split[0]) { // Checks what type of exchange furni we're dealing with default: { Session.GetHabbo().Credits += Value; Session.SendMessage(new CreditBalanceComposer(Session.GetHabbo().Credits)); break; } case "DFD": // Updates a users diamonds instead of credits. { Session.GetHabbo().Diamonds += Value; Session.SendMessage(new HabboActivityPointNotificationComposer(Session.GetHabbo().Diamonds, 0, 5)); break; } } } using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.RunQuery("DELETE FROM `items` WHERE `id` = '" + Exchange.Id + "' LIMIT 1"); } Session.SendMessage(new FurniListUpdateComposer()); Room.GetRoomItemHandler().RemoveFurniture(null, Exchange.Id, false); Session.GetHabbo().GetInventoryComponent().RemoveItem(Exchange.Id); } } } [/CODE] [B]I tried it with a normal diamond exchange swf file named: CFC_belcrbar_500 and a renamed DFD_belcrbar_500 and both had the same problem in plusEMU Thank you very very much for helping me out, Tex18[/B] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Diamond Exchange won't work [PLUSEMU]
Top