New Fix;
Its a GiveRank Command (Its a good Command)
Go to ChatCommandHandler.cs and put that:
PHP Code:
PHP Code:
#regionGive rank (:rank)
case "rank":
case "giverank":
{
if (Session.GetHabbo().HasCmd("rank"))
{
if (Params.Length < 1)
{
Session.SendNotif("You must include a Valid Rank!");
return true;
}
GameClient TargetClient = null;
Room TargetRoom = Session.GetHabbo().CurrentRoom;
using (IQueryAdapter dbClient = sul0wnEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.setQuery("UPDATE users SET rank = VALUES " + Params[2] + " WHERE username = '" + Params[1] + "' LIMIT 1" );
dbClient.runQuery();
}
TargetClient = sul0wnEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
if (TargetClient != null)
{
sul0wnEnvironment.GetGame().GetModerationTool().LogStaffEntry(Session.GetHabbo().Username, TargetClient.GetHabbo().Username, "Rank", "Rank Give To User [" + Params[2] + "]");
TargetClient.SendNotif("You Have Received a Rank , Reenter in the Hotel");
return true;
}
else
{
Session.SendNotif("User was not found");
return true;
}
}
return true;
}
#endregion
Query:
Code:
Code:
INSERT INTO `fuse_cmds` (`id`, `command`, `rank`, `params`, `description`) VALUES
(87, 'giverank', 8, '%rank% %user', 'Give rank to a user');
Im trying to Fix the Gifts, but, I really think the error its in the insert in the items_user (Invetory)
He create the item in user_presents;
Probabbily fix to Gifts:
PHP Code:
PHP Code:
Receiver.GetHabbo().GetInventoryComponent().SendFloorInventoryUpdate();
Receiver.GetMessageHandler().GetResponse().Init(Outgoing.SendPurchaseAlert);
Receiver.GetMessageHandler().GetResponse().AppendInt32(1);
Receiver.GetMessageHandler().GetResponse().AppendInt32(1);
Receiver.GetMessageHandler().GetResponse().AppendInt32(1);
Receiver.GetMessageHandler().GetResponse().AppendInt32(u.Id);
Receiver.GetMessageHandler().SendResponse();
The packet structre are wrong, this its the correct.
Put this on GameClientMessageHandler:
PHP Code:
PHP Code:
internal void OpenPresent()
{
Room room = sul0wnEnvironment.GetGame().GetRoomManager().GetRoom(this.Session.GetHabbo().CurrentRoomId);
if ((room != null) && room.CheckRights(this.Session, true))
{
uint pId = this.Request.PopWiredUInt();
RoomItem item = room.GetRoomItemHandler().GetItem(pId);
if (item != null)
{
IQueryAdapter adapter;
item.MagicRemove = true;
ServerMessage message = new ServerMessage(Outgoing.UpdateItemOnRoom);
item.Serialize(message, room.OwnerId);
room.SendMessage(message);
DataRow row = null;
using (adapter = sul0wnEnvironment.GetDatabaseManager().getQueryreactor())
{
adapter.setQuery("SELECT * FROM user_gifts WHERE gift_id = " + item.Id);
row = adapter.getRow();
}
if (row == null)
{
room.GetRoomItemHandler().RemoveFurniture(this.Session, item.Id);
}
else
{
Item item2 = sul0wnEnvironment.GetGame().GetItemManager().GetItem(Convert.ToUInt32(row["item_id"]));
if (item2 == null)
{
room.GetRoomItemHandler().RemoveFurniture(this.Session, item.Id);
}
else if (item2.Type.ToString().ToLower().Equals("s") && (item2.InteractionType != InteractionType.teleport))
{
room.GetRoomItemHandler().RemoveFurniture(this.Session, item.Id);
using (adapter = sul0wnEnvironment.GetDatabaseManager().getQueryreactor())
{
adapter.runFastQuery(string.Concat(new object[] { "UPDATE items SET base_id = '", row["item_id"], "' WHERE item_id = ", item.Id }));
adapter.setQuery(string.Concat(new object[] { "UPDATE items_extradata SET data = '" + row["extradata"] + "' WHERE item_id = " + item.Id }));
adapter.addParameter("extradata", row["extradata"]);
adapter.runQuery();
adapter.runFastQuery("DELETE FROM user_gifts WHERE gift_id = " + item.Id);
}
string s = item.GetBaseItem().Type.ToString().ToLower();
string extraData = row["extradata"].ToString();
item.BaseItem = Convert.ToUInt32(row["item_id"]);
item.refreshItem();
item.ExtraData = extraData;
if (!room.GetRoomItemHandler().SetFloorItem(this.Session, item, item.GetX, item.GetY, item.Rot, true, false, true))
{
this.Session.SendNotif("Failed to create your gift!");
}
else
{
this.Response.Init(Outgoing.OpenGift);
this.Response.AppendString(item2.Type.ToString());
this.Response.AppendInt32(item2.SpriteId);
this.Response.AppendString(item2.Name);
this.Response.AppendInt32(item.Id);
this.Response.AppendString(s);
this.Response.AppendBoolean(true);
this.Response.AppendString(extraData);
this.SendResponse();
}
}
else
{
room.GetRoomItemHandler().RemoveFurniture(this.Session, item.Id);
using (adapter = sul0wnEnvironment.GetDatabaseManager().getQueryreactor())
{
adapter.runFastQuery("DELETE FROM user_gifts WHERE gift_id = " + item.Id);
}
this.Session.GetMessageHandler().GetResponse().Init(Outgoing.SendPurchaseAlert);
this.Session.GetMessageHandler().GetResponse().AppendInt32(1);
int i = 2;
if (item2.Type.ToString().ToLower().Equals("s"))
{
if (item2.InteractionType == InteractionType.pet)
{
i = 3;
}
else
{
i = 1;
}
}
this.Session.GetMessageHandler().GetResponse().AppendInt32(i);
List<UserItem> list = sul0wnEnvironment.GetGame().GetCatalog().DeliverItems(this.Session, item2, (int)row["amount"], (string)row["extradata"], 0, 0);
this.Session.GetMessageHandler().GetResponse().AppendInt32(list.Count);
foreach (UserItem item3 in list)
{
this.Session.GetMessageHandler().GetResponse().AppendInt32(item3.Id);
}
this.Session.GetMessageHandler().SendResponse();
this.Session.GetHabbo().GetInventoryComponent().UpdateItems(true);
//this.Session.GetMessageHandler().GetResponse().Init(Outgoing.UpdateInventary);
//this.Session.GetMessageHandler().SendResponse();
}
}
}
}
this.Session.GetMessageHandler().GetResponse().Init(Outgoing.UpdateInventary);
this.Session.GetMessageHandler().SendResponse();
}
The second part of fix based on marloncolhado swift fix.
OBS: replace sul0wn to silverwave.
Edit@
I'm looking in the fast food and have a method to enable it
Change FASTFOOD = false to True on silverwave settings.cs
And the groups fix mentioned here only make not must have a f5 when buy a group to appear on room.
I'm working on the add article command to the landing view articles, the packet it's 396
And the horse don't animates, it's the on cycle, mentioned by marlon.
And the wires works if you add the interaction types from v1 of Plus, it's in the folder but isn't on the project, must only change the packets.
I will add a fix to add double database connection, to one connection for users,catalogs,etc and the another for items, likely butterfly, and a command in the .ini for: welcome message, show packets, game path(from the swf), and auto Clear from the console.
I will try to put ODBC compatibility to use pgsql, mssql, mssql, oci, and oca compatibility. Can be hard.