Well, I came in wanting the commands to open the room and close the room. I searched the Internet and could not
to find none I wanted. So I decided to create it for myself (probably if someone has these commands, maybe they are almost the same).
I developed the entire command, but I was having trouble trying to put the room icon closed and not having to stay
restarting emulator for this to appear.
GO: HabboHotel>Rooms>Chat>Commands>Administrator and enter a new code with the name OpenRoomCommand.cs
to find none I wanted. So I decided to create it for myself (probably if someone has these commands, maybe they are almost the same).
I developed the entire command, but I was having trouble trying to put the room icon closed and not having to stay
restarting emulator for this to appear.
GO: HabboHotel>Rooms>Chat>Commands>Administrator and enter a new code with the name OpenRoomCommand.cs
Code:
using Plus.Communication.Packets.Outgoing.Rooms.Notifications;
using Plus.HabboHotel.GameClients;
using Plus.Communication.Packets.Outgoing.Inventory.Purse;
using System.Text;
using Plus.Communication.Packets.Outgoing.Notifications;
using Plus.Core;
using System;
using Plus.Database.Interfaces;
namespace Plus.HabboHotel.Rooms.Chat.Commands.Administrator
{
class OpenRoomCommand : IChatCommand
{
public string PermissionRequired
{
get { return "command_openroom"; }
}
public string Parameters
{
get { return ""; }
}
public string Description
{
get { return "Abre o quarto."; }
}
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
var room = Session.GetHabbo().CurrentRoom;
room.Access = RoomAccess.OPEN;
room.RoomData.Access = RoomAccess.OPEN;
using (var queryReactor = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
queryReactor.runFastQuery(string.Format("UPDATE rooms SET state = 'open' WHERE id = {0}",
room.RoomId));
Session.SendMessage(new RoomAlertComposer("Quarto aberto com sucesso!"));
Session.SendWhisper("Comando executado com sucesso!");
}
}
}
}
GO: HabboHotel>Rooms>Chat>Commands>Administrator and enter a new code with the name CloseRoomCommand.cs
Code:
using Plus.Communication.Packets.Outgoing.Rooms.Notifications;
using Plus.HabboHotel.GameClients;
using Plus.Communication.Packets.Outgoing.Inventory.Purse;
using System.Text;
using Plus.Communication.Packets.Outgoing.Notifications;
using Plus.Core;
using System;
using Plus.Database.Interfaces;
namespace Plus.HabboHotel.Rooms.Chat.Commands.Administrator
{
class CloseRoomCommand : IChatCommand
{
public string PermissionRequired
{
get { return "command_closeroom"; }
}
public string Parameters
{
get { return ""; }
}
public string Description
{
get { return "Fecha o quarto."; }
}
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
var room = Session.GetHabbo().CurrentRoom;
room.Access = RoomAccess.DOORBELL;
room.RoomData.Access = RoomAccess.DOORBELL;
using (var queryReactor = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
queryReactor.runFastQuery(string.Format("UPDATE rooms SET state = 'locked' WHERE id = {0}",
room.RoomId));
Session.SendMessage(new RoomAlertComposer("Quarto fechado com sucesso!"));
Session.SendWhisper("Comando executado com sucesso!");
}
}
}
}
GO: HabboHotel>Rooms>Chat>Commands in CommandManager.cs
Search for private void RegisterAdministrator() and enter:
Search for private void RegisterAdministrator() and enter:
Code:
this.Register("openroom", new OpenRoomCommand());
this.Register("closeroom", new CloseRoomCommand());
Then debug everything you entered.
Then go to your database (db) in the permissions_commands table and enter:
Then go to your database (db) in the permissions_commands table and enter:
Code:
INSERT INTO `permissions_commands` (`command`, `group_id`, `subscription_id`) VALUES ('command_openroom', '6', '0');
INSERT INTO `permissions_commands` (`command`, `group_id`, `subscription_id`) VALUES ('command_closeroom', '6', '0');
Credits:
Snaiker (Pollak)
DevBest <3
Snaiker (Pollak)
DevBest <3