Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
:commands not working (plus emu)
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Enriquelol" data-source="post: 438633" data-attributes="member: 81980"><p>The :commands dialogue won't pop up. </p><p>This pops up then once you hit View commands nothing happens after that</p><p><img src="http://prntscr.com/krp265" alt="" class="fr-fic fr-dii fr-draggable " style="" /> </p><p>[CODE]namespace Plus.HabboHotel.Rooms.Chat.Commands</p><p>{</p><p> using Plus;</p><p> using Plus.Communication.Packets.Outgoing.Rooms.Notifications;</p><p> using Plus.Database.Interfaces;</p><p> using Plus.HabboHotel.GameClients;</p><p> using Plus.HabboHotel.Items.Wired;</p><p> using Plus.HabboHotel.Rooms.Chat.Commands.Administrator;</p><p> using Plus.HabboHotel.Rooms.Chat.Commands.Events;</p><p> using Plus.HabboHotel.Rooms.Chat.Commands.Moderator;</p><p> using Plus.HabboHotel.Rooms.Chat.Commands.Moderator.Fun;</p><p> using Plus.HabboHotel.Rooms.Chat.Commands.User;</p><p> using Plus.HabboHotel.Rooms.Chat.Commands.User.Fun;</p><p> using System;</p><p> using System.Collections.Generic;</p><p> using System.Runtime.InteropServices;</p><p> using System.Text;</p><p></p><p> public class CommandManager</p><p> {</p><p> private string _prefix = ":";</p><p> private readonly Dictionary<string, IChatCommand> _commands;</p><p></p><p> public CommandManager(string Prefix)</p><p> {</p><p> this._prefix = Prefix;</p><p> this._commands = new Dictionary<string, IChatCommand>();</p><p> this.RegisterVIP();</p><p> this.RegisterUser();</p><p> this.RegisterEvents();</p><p> this.RegisterModerator();</p><p> this.RegisterAdministrator();</p><p> }</p><p></p><p> public void LogCommand(int UserId, string Data, string MachineId)</p><p> {</p><p> using (IQueryAdapter adapter = PlusEnvironment.GetDatabaseManager().GetQueryReactor())</p><p> {</p><p> adapter.SetQuery("INSERT INTO `logs_client_staff` (`user_id`,`data_string`,`machine_id`, `timestamp`) VALUES (@UserId,@Data,@MachineId,@Timestamp)");</p><p> adapter.AddParameter("UserId", UserId);</p><p> adapter.AddParameter("Data", Data);</p><p> adapter.AddParameter("MachineId", MachineId);</p><p> adapter.AddParameter("Timestamp", PlusEnvironment.GetUnixTimestamp());</p><p> adapter.RunQuery();</p><p> }</p><p> }</p><p></p><p> public static string MergeParams(string[] Params, int Start)</p><p> {</p><p> StringBuilder builder = new StringBuilder();</p><p> for (int i = Start; i < Params.Length; i++)</p><p> {</p><p> if (i > Start)</p><p> {</p><p> builder.Append(" ");</p><p> }</p><p> builder.Append(Params[i]);</p><p> }</p><p> return builder.ToString();</p><p> }</p><p></p><p> public bool Parse(GameClient Session, string Message)</p><p> {</p><p> if (((Session != null) && (Session.GetHabbo() != null)) && (Session.GetHabbo().CurrentRoom != null))</p><p> {</p><p> if (!Message.StartsWith(this._prefix))</p><p> {</p><p> return false;</p><p> }</p><p> if (Message == (this._prefix + "commands"))</p><p> {</p><p> Session.SendPacket(new RoomNotificationComposer("Commands", "Click the button below for a list of our commands.", "", "View Commands!", "event:habbopages/" + Session.GetHabbo().Rank));</p><p> return true;</p><p> }</p><p> Message = Message.Substring(1);</p><p> char[] separator = new char[] { ' ' };</p><p> string[] @params = Message.Split(separator);</p><p> if (@params.Length == 0)</p><p> {</p><p> return false;</p><p> }</p><p> IChatCommand command = null;</p><p> if (this._commands.TryGetValue(@params[0].ToLower(), out command))</p><p> {</p><p> if (Session.GetHabbo().GetPermissions().HasRight("mod_tool"))</p><p> {</p><p> this.LogCommand(Session.GetHabbo().Id, Message, Session.GetHabbo().MachineId);</p><p> }</p><p> if (!string.IsNullOrEmpty(command.PermissionRequired) && !Session.GetHabbo().GetPermissions().HasCommand(command.PermissionRequired))</p><p> {</p><p> return false;</p><p> }</p><p> Session.GetHabbo().IChatCommand = command;</p><p> object[] objArray1 = new object[] { Session.GetHabbo(), this };</p><p> Session.GetHabbo().CurrentRoom.GetWired().TriggerEvent(WiredBoxType.TriggerUserSaysCommand, objArray1);</p><p> command.Execute(Session, Session.GetHabbo().CurrentRoom, @params);</p><p> return true;</p><p> }</p><p> }</p><p> return false;</p><p> }</p><p></p><p> public void Register(string CommandText, IChatCommand Command)</p><p> {</p><p> this._commands.Add(CommandText, Command);</p><p> }</p><p></p><p> private void RegisterAdministrator()</p><p> {</p><p> this.Register("bubble", new BubbleCommand());</p><p> this.Register("update", new UpdateCommand());</p><p> this.Register("deletegroup", new DeleteGroupCommand());</p><p> this.Register("carry", new CarryCommand());</p><p> this.Register("goto", new GOTOCommand());</p><p> this.Register("modtools", new ModToolsCommand());</p><p> this.Register("resetgotw", new ResetGotwCommand());</p><p> this.Register("viewinventory", new ViewInventoryCommand());</p><p> this.Register("inv", new ViewInventoryCommand());</p><p> }</p><p></p><p> private void RegisterEvents()</p><p> {</p><p> this.Register("eha", new EventAlertCommand());</p><p> this.Register("eventalert", new EventAlertCommand());</p><p> }</p><p></p><p> private void RegisterModerator()</p><p> {</p><p> this.Register("ban", new BanCommand());</p><p> this.Register("mip", new MIPCommand());</p><p> this.Register("ipban", new IPBanCommand());</p><p> this.Register("viewpm", new ViewPMCommand());</p><p> this.Register("jail", new JailUserCommand());</p><p> this.Register("ui", new UserInfoCommand());</p><p> this.Register("userinfo", new UserInfoCommand());</p><p> this.Register("sa", new StaffAlertCommand());</p><p> this.Register("roomunmute", new RoomUnmuteCommand());</p><p> this.Register("roommute", new RoomMuteCommand());</p><p> this.Register("roombadge", new RoomBadgeCommand());</p><p> this.Register("roomalert", new RoomAlertCommand());</p><p> this.Register("roomkick", new RoomKickCommand());</p><p> this.Register("mute", new MuteCommand());</p><p> this.Register("smute", new MuteCommand());</p><p> this.Register("unmute", new UnmuteCommand());</p><p> this.Register("massbadge", new MassBadgeCommand());</p><p> this.Register("kick", new KickCommand());</p><p> this.Register("skick", new KickCommand());</p><p> this.Register("ha", new HotelAlertCommand());</p><p> this.Register("hotelalert", new HotelAlertCommand());</p><p> this.Register("hal", new HALCommand());</p><p> this.Register("give", new GiveCommand());</p><p> this.Register("givebadge", new GiveBadgeCommand());</p><p> this.Register("dc", new DisconnectCommand());</p><p> this.Register("kill", new DisconnectCommand());</p><p> this.Register("disconnect", new DisconnectCommand());</p><p> this.Register("alert", new AlertCommand());</p><p> this.Register("tradeban", new TradeBanCommand());</p><p> this.Register("teleport", new TeleportCommand());</p><p> this.Register("summon", new SummonCommand());</p><p> this.Register("override", new OverrideCommand());</p><p> this.Register("massenable", new MassEnableCommand());</p><p> this.Register("massdance", new MassDanceCommand());</p><p> this.Register("freeze", new FreezeCommand());</p><p> this.Register("unfreeze", new UnFreezeCommand());</p><p> this.Register("fastwalk", new FastwalkCommand());</p><p> this.Register("superfastwalk", new SuperFastwalkCommand());</p><p> this.Register("coords", new CoordsCommand());</p><p> this.Register("alleyesonme", new AllEyesOnMeCommand());</p><p> this.Register("allaroundme", new AllAroundMeCommand());</p><p> this.Register("forcesit", new ForceSitCommand());</p><p> this.Register("ignorewhispers", new IgnoreWhispersCommand());</p><p> this.Register("forced_effects", new DisableForcedFXCommand());</p><p> this.Register("makesay", new MakeSayCommand());</p><p> this.Register("flaguser", new FlagUserCommand());</p><p> this.Register("quickpoll", new QuickPollCommand());</p><p> }</p><p></p><p> private void RegisterUser()</p><p> {</p><p> this.Register("about", new InfoCommand());</p><p> this.Register("pickall", new PickAllCommand());</p><p> this.Register("ejectall", new EjectAllCommand());</p><p> this.Register("lay", new LayCommand());</p><p> this.Register("sit", new SitCommand());</p><p> this.Register("stand", new StandCommand());</p><p> this.Register("mutepets", new MutePetsCommand());</p><p> this.Register("mutebots", new MuteBotsCommand());</p><p> this.Register("mimic", new MimicCommand());</p><p> this.Register("dance", new DanceCommand());</p><p> this.Register("push", new PushCommand());</p><p> this.Register("pull", new PullCommand());</p><p> this.Register("enable", new EnableCommand());</p><p> this.Register("follow", new FollowCommand());</p><p> this.Register("faceless", new FacelessCommand());</p><p> this.Register("moonwalk", new MoonwalkCommand());</p><p> this.Register("unload", new UnloadCommand());</p><p> this.Register("regenmaps", new RegenMaps());</p><p> this.Register("emptyitems", new EmptyItems());</p><p> this.Register("setmax", new SetMaxCommand());</p><p> this.Register("setspeed", new SetSpeedCommand());</p><p> this.Register("disablediagonal", new DisableDiagonalCommand());</p><p> this.Register("flagme", new FlagMeCommand());</p><p> this.Register("stats", new StatsCommand());</p><p> this.Register("kickpets", new KickPetsCommand());</p><p> this.Register("kickbots", new KickBotsCommand());</p><p> this.Register("room", new RoomCommand());</p><p> this.Register("dnd", new DNDCommand());</p><p> this.Register("disablegifts", new DisableGiftsCommand());</p><p> this.Register("convertcredits", new ConvertCreditsCommand());</p><p> this.Register("disablewhispers", new DisableWhispersCommand());</p><p> this.Register("disablemimic", new DisableMimicCommand());</p><p> this.Register("pet", new PetCommand());</p><p> this.Register("rolldice", new RollDiceCommand());</p><p> this.Register("closedice", new CloseDiceCommand());</p><p> this.Register("sh", new BuildHeightCommand());</p><p> this.Register("pay", new PayCommand());</p><p> this.Register("events", new NotificationCommand());</p><p> this.Register("globalmute", new GlobalMuteCommand());</p><p> this.Register("globaltradeban", new GlobalTradeBanCommand());</p><p> this.Register("discord", new DiscordAlert());</p><p> this.Register("sandbox", new SetRoomSandboxCommand());</p><p> this.Register("roombundle", new RoomBundleCommand());</p><p> this.Register("setcolor", new ColorSetCommand());</p><p> this.Register("notify", new AlertHotelCommand());</p><p> this.Register("warp", new WarpCommand());</p><p> this.Register("reload", new ReloadRoomCommand());</p><p> this.Register("poll", new CreatePollCommand());</p><p> this.Register("badgedef", new SetBadgeDefCommand());</p><p> this.Register("sellroom", new SellRoomCommand());</p><p> this.Register("buyroom", new BuyRoomCommand());</p><p> this.Register("hidewired", new HideWiredCommand());</p><p> this.Register("StaffOnline", new StaffOnline());</p><p> }</p><p></p><p> private void RegisterVIP()</p><p> {</p><p> this.Register("spull", new SuperPullCommand());</p><p> this.Register("spush", new SuperPushCommand());</p><p> this.Register("superpush", new SuperPushCommand());</p><p> }</p><p></p><p> public bool TryGetCommand(string Command, out IChatCommand IChatCommand) =></p><p> this._commands.TryGetValue(Command, out IChatCommand);</p><p> }</p><p>}</p><p></p><p>[/CODE]</p><p></p><p>Here is the code</p></blockquote><p></p>
[QUOTE="Enriquelol, post: 438633, member: 81980"] The :commands dialogue won't pop up. This pops up then once you hit View commands nothing happens after that [IMG]http://prntscr.com/krp265[/IMG] [CODE]namespace Plus.HabboHotel.Rooms.Chat.Commands { using Plus; using Plus.Communication.Packets.Outgoing.Rooms.Notifications; using Plus.Database.Interfaces; using Plus.HabboHotel.GameClients; using Plus.HabboHotel.Items.Wired; using Plus.HabboHotel.Rooms.Chat.Commands.Administrator; using Plus.HabboHotel.Rooms.Chat.Commands.Events; using Plus.HabboHotel.Rooms.Chat.Commands.Moderator; using Plus.HabboHotel.Rooms.Chat.Commands.Moderator.Fun; using Plus.HabboHotel.Rooms.Chat.Commands.User; using Plus.HabboHotel.Rooms.Chat.Commands.User.Fun; using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; public class CommandManager { private string _prefix = ":"; private readonly Dictionary<string, IChatCommand> _commands; public CommandManager(string Prefix) { this._prefix = Prefix; this._commands = new Dictionary<string, IChatCommand>(); this.RegisterVIP(); this.RegisterUser(); this.RegisterEvents(); this.RegisterModerator(); this.RegisterAdministrator(); } public void LogCommand(int UserId, string Data, string MachineId) { using (IQueryAdapter adapter = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { adapter.SetQuery("INSERT INTO `logs_client_staff` (`user_id`,`data_string`,`machine_id`, `timestamp`) VALUES (@UserId,@Data,@MachineId,@Timestamp)"); adapter.AddParameter("UserId", UserId); adapter.AddParameter("Data", Data); adapter.AddParameter("MachineId", MachineId); adapter.AddParameter("Timestamp", PlusEnvironment.GetUnixTimestamp()); adapter.RunQuery(); } } public static string MergeParams(string[] Params, int Start) { StringBuilder builder = new StringBuilder(); for (int i = Start; i < Params.Length; i++) { if (i > Start) { builder.Append(" "); } builder.Append(Params[i]); } return builder.ToString(); } public bool Parse(GameClient Session, string Message) { if (((Session != null) && (Session.GetHabbo() != null)) && (Session.GetHabbo().CurrentRoom != null)) { if (!Message.StartsWith(this._prefix)) { return false; } if (Message == (this._prefix + "commands")) { Session.SendPacket(new RoomNotificationComposer("Commands", "Click the button below for a list of our commands.", "", "View Commands!", "event:habbopages/" + Session.GetHabbo().Rank)); return true; } Message = Message.Substring(1); char[] separator = new char[] { ' ' }; string[] @params = Message.Split(separator); if (@params.Length == 0) { return false; } IChatCommand command = null; if (this._commands.TryGetValue(@params[0].ToLower(), out command)) { if (Session.GetHabbo().GetPermissions().HasRight("mod_tool")) { this.LogCommand(Session.GetHabbo().Id, Message, Session.GetHabbo().MachineId); } if (!string.IsNullOrEmpty(command.PermissionRequired) && !Session.GetHabbo().GetPermissions().HasCommand(command.PermissionRequired)) { return false; } Session.GetHabbo().IChatCommand = command; object[] objArray1 = new object[] { Session.GetHabbo(), this }; Session.GetHabbo().CurrentRoom.GetWired().TriggerEvent(WiredBoxType.TriggerUserSaysCommand, objArray1); command.Execute(Session, Session.GetHabbo().CurrentRoom, @params); return true; } } return false; } public void Register(string CommandText, IChatCommand Command) { this._commands.Add(CommandText, Command); } private void RegisterAdministrator() { this.Register("bubble", new BubbleCommand()); this.Register("update", new UpdateCommand()); this.Register("deletegroup", new DeleteGroupCommand()); this.Register("carry", new CarryCommand()); this.Register("goto", new GOTOCommand()); this.Register("modtools", new ModToolsCommand()); this.Register("resetgotw", new ResetGotwCommand()); this.Register("viewinventory", new ViewInventoryCommand()); this.Register("inv", new ViewInventoryCommand()); } private void RegisterEvents() { this.Register("eha", new EventAlertCommand()); this.Register("eventalert", new EventAlertCommand()); } private void RegisterModerator() { this.Register("ban", new BanCommand()); this.Register("mip", new MIPCommand()); this.Register("ipban", new IPBanCommand()); this.Register("viewpm", new ViewPMCommand()); this.Register("jail", new JailUserCommand()); this.Register("ui", new UserInfoCommand()); this.Register("userinfo", new UserInfoCommand()); this.Register("sa", new StaffAlertCommand()); this.Register("roomunmute", new RoomUnmuteCommand()); this.Register("roommute", new RoomMuteCommand()); this.Register("roombadge", new RoomBadgeCommand()); this.Register("roomalert", new RoomAlertCommand()); this.Register("roomkick", new RoomKickCommand()); this.Register("mute", new MuteCommand()); this.Register("smute", new MuteCommand()); this.Register("unmute", new UnmuteCommand()); this.Register("massbadge", new MassBadgeCommand()); this.Register("kick", new KickCommand()); this.Register("skick", new KickCommand()); this.Register("ha", new HotelAlertCommand()); this.Register("hotelalert", new HotelAlertCommand()); this.Register("hal", new HALCommand()); this.Register("give", new GiveCommand()); this.Register("givebadge", new GiveBadgeCommand()); this.Register("dc", new DisconnectCommand()); this.Register("kill", new DisconnectCommand()); this.Register("disconnect", new DisconnectCommand()); this.Register("alert", new AlertCommand()); this.Register("tradeban", new TradeBanCommand()); this.Register("teleport", new TeleportCommand()); this.Register("summon", new SummonCommand()); this.Register("override", new OverrideCommand()); this.Register("massenable", new MassEnableCommand()); this.Register("massdance", new MassDanceCommand()); this.Register("freeze", new FreezeCommand()); this.Register("unfreeze", new UnFreezeCommand()); this.Register("fastwalk", new FastwalkCommand()); this.Register("superfastwalk", new SuperFastwalkCommand()); this.Register("coords", new CoordsCommand()); this.Register("alleyesonme", new AllEyesOnMeCommand()); this.Register("allaroundme", new AllAroundMeCommand()); this.Register("forcesit", new ForceSitCommand()); this.Register("ignorewhispers", new IgnoreWhispersCommand()); this.Register("forced_effects", new DisableForcedFXCommand()); this.Register("makesay", new MakeSayCommand()); this.Register("flaguser", new FlagUserCommand()); this.Register("quickpoll", new QuickPollCommand()); } private void RegisterUser() { this.Register("about", new InfoCommand()); this.Register("pickall", new PickAllCommand()); this.Register("ejectall", new EjectAllCommand()); this.Register("lay", new LayCommand()); this.Register("sit", new SitCommand()); this.Register("stand", new StandCommand()); this.Register("mutepets", new MutePetsCommand()); this.Register("mutebots", new MuteBotsCommand()); this.Register("mimic", new MimicCommand()); this.Register("dance", new DanceCommand()); this.Register("push", new PushCommand()); this.Register("pull", new PullCommand()); this.Register("enable", new EnableCommand()); this.Register("follow", new FollowCommand()); this.Register("faceless", new FacelessCommand()); this.Register("moonwalk", new MoonwalkCommand()); this.Register("unload", new UnloadCommand()); this.Register("regenmaps", new RegenMaps()); this.Register("emptyitems", new EmptyItems()); this.Register("setmax", new SetMaxCommand()); this.Register("setspeed", new SetSpeedCommand()); this.Register("disablediagonal", new DisableDiagonalCommand()); this.Register("flagme", new FlagMeCommand()); this.Register("stats", new StatsCommand()); this.Register("kickpets", new KickPetsCommand()); this.Register("kickbots", new KickBotsCommand()); this.Register("room", new RoomCommand()); this.Register("dnd", new DNDCommand()); this.Register("disablegifts", new DisableGiftsCommand()); this.Register("convertcredits", new ConvertCreditsCommand()); this.Register("disablewhispers", new DisableWhispersCommand()); this.Register("disablemimic", new DisableMimicCommand()); this.Register("pet", new PetCommand()); this.Register("rolldice", new RollDiceCommand()); this.Register("closedice", new CloseDiceCommand()); this.Register("sh", new BuildHeightCommand()); this.Register("pay", new PayCommand()); this.Register("events", new NotificationCommand()); this.Register("globalmute", new GlobalMuteCommand()); this.Register("globaltradeban", new GlobalTradeBanCommand()); this.Register("discord", new DiscordAlert()); this.Register("sandbox", new SetRoomSandboxCommand()); this.Register("roombundle", new RoomBundleCommand()); this.Register("setcolor", new ColorSetCommand()); this.Register("notify", new AlertHotelCommand()); this.Register("warp", new WarpCommand()); this.Register("reload", new ReloadRoomCommand()); this.Register("poll", new CreatePollCommand()); this.Register("badgedef", new SetBadgeDefCommand()); this.Register("sellroom", new SellRoomCommand()); this.Register("buyroom", new BuyRoomCommand()); this.Register("hidewired", new HideWiredCommand()); this.Register("StaffOnline", new StaffOnline()); } private void RegisterVIP() { this.Register("spull", new SuperPullCommand()); this.Register("spush", new SuperPushCommand()); this.Register("superpush", new SuperPushCommand()); } public bool TryGetCommand(string Command, out IChatCommand IChatCommand) => this._commands.TryGetValue(Command, out IChatCommand); } } [/CODE] Here is the code [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
:commands not working (plus emu)
Top