if (!Exchange.GetBaseItem().ItemName.StartsWith("CF_") && !Exchange.GetBaseItem().ItemName.StartsWith("CFC_") && !Exchange.GetBaseItem().ItemName.StartsWith("DF_") && !Exchange.GetBaseItem().ItemName.StartsWith("DFD_"))
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("DF_") || Exchange.GetBaseItem().ItemName.StartsWith("DFD_"))
{
Session.GetHabbo().Diamonds += Value;
Session.SendMessage(new HabboActivityPointNotificationComposer(Session.GetHabbo().Diamonds, Value, 5));
}
}
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.Data;
using Plus.HabboHotel.Items;
using Plus.Communication.Packets.Outgoing.Inventory.Purse;
using Plus.Database.Interfaces;
namespace Plus.HabboHotel.Rooms.Chat.Commands.User
{
class ConvertDiamondsCommand : IChatCommand
{
public string PermissionRequired
{
get { return "command_convert_diamonds"; }
}
public string Parameters
{
get { return ""; }
}
public string Description
{
get { return "Convert your exchangeable furniture into actual diamonds."; }
}
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
int TotalValue = 0;
try
{
DataTable Table = null;
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.SetQuery("SELECT `id` FROM `items` WHERE `user_id` = '" + Session.GetHabbo().Id + "' AND (`room_id`= '0' OR `room_id` = '')");
Table = dbClient.getTable();
}
if (Table == null)
{
Session.SendWhisper("You currently have no items in your inventory!");
return;
}
foreach (DataRow Row in Table.Rows)
{
Item Item = Session.GetHabbo().GetInventoryComponent().GetItem(Convert.ToInt32(Row[0]));
if (Item == null)
continue;
if (!Item.GetBaseItem().ItemName.StartsWith("DF_") && !Item.GetBaseItem().ItemName.StartsWith("DFD_"))
continue;
if (Item.RoomId > 0)
continue;
string[] Split = Item.GetBaseItem().ItemName.Split('_');
int Value = int.Parse(Split[1]);
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("DELETE FROM `items` WHERE `id` = '" + Item.Id + "' LIMIT 1");
}
Session.GetHabbo().GetInventoryComponent().RemoveItem(Item.Id);
TotalValue += Value;
if (Value > 0)
{
Session.GetHabbo().Diamonds += Value;
Session.SendMessage(new CreditBalanceComposer(Session.GetHabbo().Diamonds));
}
}
if (TotalValue > 0)
Session.SendNotification("All credits have successfully been converted!\r\r(Total value: " + TotalValue + " Diamonds!");
else
Session.SendNotification("It appears you don't have any exchangeable items!");
}
catch
{
Session.SendNotification("Oops, an error occoured whilst converting your diamonds!");
}
}
}
}
I want to add this. How do i exactly add.. I tried to edit file with notepad++... Didnt work!go to CreditFurniRedeemEvemt.cs
find where it states CF_
replace that if section with this
Code:if (!Exchange.GetBaseItem().ItemName.StartsWith("CF_") && !Exchange.GetBaseItem().ItemName.StartsWith("CFC_") && !Exchange.GetBaseItem().ItemName.StartsWith("DF_") && !Exchange.GetBaseItem().ItemName.StartsWith("DFD_")) 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("DF_") || Exchange.GetBaseItem().ItemName.StartsWith("DFD_")) { Session.GetHabbo().Diamonds += Value; Session.SendMessage(new HabboActivityPointNotificationComposer(Session.GetHabbo().Diamonds, Value, 5)); } }
The just in your furniture table for that item name it DF_AMOUNT_anynamehere
Hey!You need visual studio.
When i take DF_ or _DFD in the furniture table... The furni wont exchangeYou need visual studio.