Supermario
Member
- Jan 5, 2016
- 99
- 0
Hello,
How do I make an item redeem into diamonds? Example. I buy a crown for 25 diamonds, then I want it to redeem for 25 diamonds.
I tried doing.
but it still redeems as coins. Any suggestions?
How do I make an item redeem into diamonds? Example. I buy a crown for 25 diamonds, then I want it to redeem for 25 diamonds.
Code:
if (!Exchange.GetBaseItem().ItemName.StartsWith("CF_") && !Exchange.GetBaseItem().ItemName.StartsWith("CFC_") && !Exchange.GetBaseItem().ItemName.StartsWith("CF_diamond") && !Exchange.GetBaseItem().ItemName.StartsWith("DFD_diamond"))
return;
string[] Split = Exchange.GetBaseItem().ItemName.Split('_');
int Value = int.Parse(Split[1]);
if (Value > 0)
{
if (Exchange.GetBaseItem().ItemName.StartsWith("CF_") || Exchange.GetBaseItem().ItemName.StartsWith("CFC_"))
{
Session.GetHabbo().Credits += Value;
Session.SendMessage(new CreditBalanceComposer(Session.GetHabbo().Credits));
}
else if (Exchange.GetBaseItem().ItemName.StartsWith("CF_diamond") || Exchange.GetBaseItem().ItemName.StartsWith("DFD_diamond"))
{
Session.GetHabbo().Diamonds += Value;
Session.SendMessage(new HabboActivityPointNotificationComposer(Session.GetHabbo().Diamonds, Value, 5));
}
}
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);
}
}
}