Marko97
M97 Project based Plus EMU
- Aug 7, 2013
- 99
- 45
Hi,
Today I will share with you a mini command made by me.
This command perform the erase for chatlogs.
1. Go to HabboHotel/Rooms/Chat/Commands/Administrator and create a new class called: EraseChatlogCommand.cs and paste this:
2. Go to HabboHotel/Rooms/Chat/Commands/CommandManager.cs and after
add this:
:
3. In your database run this MySQL Query:
Note: You can change the rank and Vip rank modifying '1' (Rank), '1' (Vip rank) at your leisure.
Done! To launch the command use :erasechatlog.
IF YOU WANT DELETE ONLY ROOM MESSAGGES YOU CAN FOLLOW THIS:
Today I will share with you a mini command made by me.
This command perform the erase for chatlogs.
1. Go to HabboHotel/Rooms/Chat/Commands/Administrator and create a new class called: EraseChatlogCommand.cs and paste this:
Code:
using Plus.HabboHotel.GameClients;
using Plus.Database.Interfaces;
namespace Plus.HabboHotel.Rooms.Chat.Commands.Administrator
{
class EraseChatlogCommand : IChatCommand
{
public string PermissionRequired
{
get { return "command_erasechatlog"; }
}
public string Parameters
{
get { return ""; }
}
public string Description
{
get { return "Erase the chatlog."; }
}
public void Execute(GameClient Session, Room Room, string[] Params)
{
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
dbClient.RunQuery("TRUNCATE chatlogs");
}
Session.SendNotification("Chatlog erased.");
}
}
}
2. Go to HabboHotel/Rooms/Chat/Commands/CommandManager.cs and after
Code:
this.Register("update", new UpdateCommand());
Code:
this.Register("erasechatlog", new EraseChatlogCommand());
3. In your database run this MySQL Query:
Code:
INSERT INTO `permissions_commands` (`command`, `group_id`, `subscription_id`) VALUES ('command_erasechatlog', '1', '1');
Done! To launch the command use :erasechatlog.
IF YOU WANT DELETE ONLY ROOM MESSAGGES YOU CAN FOLLOW THIS:
1. Go to HabboHotel/Rooms/Chat/Commands/Administrator and create a new class called: EraseRoomChatlogCommand.cs and paste this:
2. Go to HabboHotel/Rooms/Chat/Commands/CommandManager.cs and afterCode:using Plus.HabboHotel.GameClients; using Plus.Database.Interfaces; namespace Plus.HabboHotel.Rooms.Chat.Commands.Administrator { class EraseRoomChatlogCommand : IChatCommand { public string PermissionRequired { get { return "command_eraseroomchatlog"; } } public string Parameters { get { return ""; } } public string Description { get { return "Erase the room chatlog."; } } public void Execute(GameClient Session, Room Room, string[] Params) { using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("DELETE FROM `chatlogs` WHERE `room_id` = @RoomId"); dbClient.AddParameter("RoomId", Session.GetHabbo().CurrentRoom.Id); dbClient.RunQuery(); } Session.SendNotification("All messagges in " + Session.GetHabbo().CurrentRoom.Name + "'s room have been deleted."); } } }
add this:Code:this.Register("update", new UpdateCommand());
3. In your database run this MySQL Query:Code:this.Register("eraseroomchatlog", new EraseRoomChatlogCommand());
Note: You can change the rank and Vip rank modifying '1' (Rank), '1' (Vip rank) at your leisure.Code:INSERT INTO `permissions_commands` (`command`, `group_id`, `subscription_id`) VALUES ('command_eraseroomchatlog', '1', '1');
Last edited: