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
EventAlert Command doesn't work
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="Twister" data-source="post: 435194" data-attributes="member: 59638"><p>Hello DevBest,</p><p>I install new PRODUCTION-201802201205-141713395 on PlusEmuR2 and I try to fixe EventAlertCommand. But she doesn't work, when I execute this commande on the client nothing is coming.</p><p>This is my EventCommand.cs</p><p>[CODE]</p><p></p><p>using Plus.Communication.Packets.Outgoing.Moderation;</p><p>using Plus.Communication.Packets.Outgoing.Rooms.Notifications;</p><p>using Plus.HabboHotel.GameClients;</p><p>using System;</p><p>using System.Linq;</p><p>namespace Plus.HabboHotel.Rooms.Chat.Commands.Events</p><p>{</p><p> internal class EventAlertCommand : IChatCommand</p><p> {</p><p> public string PermissionRequired</p><p> {</p><p> get</p><p> {</p><p> return "command_event_alert";</p><p> }</p><p> }</p><p> public string Parameters</p><p> {</p><p> get</p><p> {</p><p> return "";</p><p> }</p><p> }</p><p> public string Description</p><p> {</p><p> get</p><p> {</p><p> return "Permet d'envoyer une alerte concernant les animations.";</p><p> }</p><p> }</p><p> public void Execute(GameClient Session, Room Room, string[] Params)</p><p> {</p><p> if (Params.Length == 1)</p><p> {</p><p> Session.SendWhisper("Merci d'entrer un message pour l'évenement a annoncer exemple d'utilisation de la commande :eventha message");</p><p> return;</p><p> }</p><p></p><p> string Message = CommandManager.MergeParams(Params, 1);</p><p> PlusEnvironment.GetGame().GetClientManager().SendPacket(new RoomNotificationComposer("Messages des animateurs", "Une nouvelle animation se déroule chez <b> " + Room.OwnerName + "</b>.\n\nDépêche toi de participer avan que l'appart ne soit fermé ! Clique sur le bouton <b><i> Aller dans l'appart</i></b> pour participer à l'animation. \n\n" + "Plus de détails :<b> " + Message + "</b>\n\n", "evento", "Aller dans l'appart", "event:navigator/goto/" + Session.GetHabbo().CurrentRoom.RoomId));</p><p></p><p> }</p><p> }</p><p>}</p><p>[/CODE]</p><p></p><p>and the code of RoomNotificationComposer.cs</p><p>[CODE]using System;</p><p>using System.Linq;</p><p>using System.Text;</p><p>using System.Collections.Generic;</p><p></p><p>namespace Plus.Communication.Packets.Outgoing.Rooms.Notifications</p><p>{</p><p> class RoomNotificationComposer : ServerPacket</p><p> {</p><p> public RoomNotificationComposer(string Title, string Message, string Image, string HotelName = "", string HotelURL = "")</p><p> : base(ServerPacketHeader.RoomNotificationMessageComposer)</p><p> {</p><p> base.WriteString(Image);</p><p> base.WriteInteger(string.IsNullOrEmpty(HotelName) ? 2 : 4);</p><p> base.WriteString("title");</p><p> base.WriteString(Title);</p><p> base.WriteString("message");</p><p> base.WriteString(Message);</p><p></p><p> if (!string.IsNullOrEmpty(HotelName))</p><p> {</p><p> base.WriteString("linkUrl");</p><p> base.WriteString(HotelURL);</p><p> base.WriteString("linkTitle");</p><p> base.WriteString(HotelName);</p><p> }</p><p> }</p><p></p><p> public RoomNotificationComposer(string Type, string Key, string Value)</p><p> : base(ServerPacketHeader.RoomNotificationMessageComposer)</p><p> {</p><p> base.WriteString(Type);</p><p> base.WriteInteger(1);//Count</p><p> {</p><p> base.WriteString(Key);//Type of message</p><p> base.WriteString(Value);</p><p> }</p><p> }</p><p></p><p> public RoomNotificationComposer(string type, Dictionary<string, string> dataDict)</p><p> : base(ServerPacketHeader.RoomNotificationMessageComposer)</p><p> {</p><p> base.WriteString(type);</p><p></p><p> // Assumed 'count' of key-value pairs is equal to num keys.</p><p> // Hopefully no one puts a null value.</p><p> base.WriteInteger(dataDict.Keys.Count);</p><p></p><p> foreach (KeyValuePair<string, string> dictPair in dataDict)</p><p> {</p><p> base.WriteString(dictPair.Key);</p><p> base.WriteString(dictPair.Value);</p><p> }</p><p> }</p><p></p><p> public static ServerPacket SendBubble(string image, string message, string linkUrl = "")</p><p> {</p><p> var bubbleNotification = new ServerPacket(ServerPacketHeader.RoomNotificationMessageComposer);</p><p> bubbleNotification.WriteString(image);</p><p> bubbleNotification.WriteInteger(string.IsNullOrEmpty(linkUrl) ? 2 : 3);</p><p> bubbleNotification.WriteString("display");</p><p> bubbleNotification.WriteString("BUBBLE");</p><p> bubbleNotification.WriteString("message");</p><p> bubbleNotification.WriteString(message);</p><p> if (string.IsNullOrEmpty(linkUrl)) return bubbleNotification;</p><p> bubbleNotification.WriteString("linkUrl");</p><p> bubbleNotification.WriteString(linkUrl);</p><p> return bubbleNotification;</p><p> }</p><p></p><p> public RoomNotificationComposer(string Type)</p><p> : base(ServerPacketHeader.RoomNotificationMessageComposer)</p><p> {</p><p> base.WriteString(Type);</p><p> base.WriteInteger(0);//Count</p><p> }</p><p></p><p> }</p><p>}</p><p>[/CODE]</p><p></p><p>My packet for RoomNotificationMessageComposer -> 2940</p><p></p><p>Thnks for your help</p><p>Have a good day</p><p></p><p>PS: I have see my AboutCommand doesn't work. I think the problem come RoomNotificationComposer</p></blockquote><p></p>
[QUOTE="Twister, post: 435194, member: 59638"] Hello DevBest, I install new PRODUCTION-201802201205-141713395 on PlusEmuR2 and I try to fixe EventAlertCommand. But she doesn't work, when I execute this commande on the client nothing is coming. This is my EventCommand.cs [CODE] using Plus.Communication.Packets.Outgoing.Moderation; using Plus.Communication.Packets.Outgoing.Rooms.Notifications; using Plus.HabboHotel.GameClients; using System; using System.Linq; namespace Plus.HabboHotel.Rooms.Chat.Commands.Events { internal class EventAlertCommand : IChatCommand { public string PermissionRequired { get { return "command_event_alert"; } } public string Parameters { get { return ""; } } public string Description { get { return "Permet d'envoyer une alerte concernant les animations."; } } public void Execute(GameClient Session, Room Room, string[] Params) { if (Params.Length == 1) { Session.SendWhisper("Merci d'entrer un message pour l'évenement a annoncer exemple d'utilisation de la commande :eventha message"); return; } string Message = CommandManager.MergeParams(Params, 1); PlusEnvironment.GetGame().GetClientManager().SendPacket(new RoomNotificationComposer("Messages des animateurs", "Une nouvelle animation se déroule chez <b> " + Room.OwnerName + "</b>.\n\nDépêche toi de participer avan que l'appart ne soit fermé ! Clique sur le bouton <b><i> Aller dans l'appart</i></b> pour participer à l'animation. \n\n" + "Plus de détails :<b> " + Message + "</b>\n\n", "evento", "Aller dans l'appart", "event:navigator/goto/" + Session.GetHabbo().CurrentRoom.RoomId)); } } } [/CODE] and the code of RoomNotificationComposer.cs [CODE]using System; using System.Linq; using System.Text; using System.Collections.Generic; namespace Plus.Communication.Packets.Outgoing.Rooms.Notifications { class RoomNotificationComposer : ServerPacket { public RoomNotificationComposer(string Title, string Message, string Image, string HotelName = "", string HotelURL = "") : base(ServerPacketHeader.RoomNotificationMessageComposer) { base.WriteString(Image); base.WriteInteger(string.IsNullOrEmpty(HotelName) ? 2 : 4); base.WriteString("title"); base.WriteString(Title); base.WriteString("message"); base.WriteString(Message); if (!string.IsNullOrEmpty(HotelName)) { base.WriteString("linkUrl"); base.WriteString(HotelURL); base.WriteString("linkTitle"); base.WriteString(HotelName); } } public RoomNotificationComposer(string Type, string Key, string Value) : base(ServerPacketHeader.RoomNotificationMessageComposer) { base.WriteString(Type); base.WriteInteger(1);//Count { base.WriteString(Key);//Type of message base.WriteString(Value); } } public RoomNotificationComposer(string type, Dictionary<string, string> dataDict) : base(ServerPacketHeader.RoomNotificationMessageComposer) { base.WriteString(type); // Assumed 'count' of key-value pairs is equal to num keys. // Hopefully no one puts a null value. base.WriteInteger(dataDict.Keys.Count); foreach (KeyValuePair<string, string> dictPair in dataDict) { base.WriteString(dictPair.Key); base.WriteString(dictPair.Value); } } public static ServerPacket SendBubble(string image, string message, string linkUrl = "") { var bubbleNotification = new ServerPacket(ServerPacketHeader.RoomNotificationMessageComposer); bubbleNotification.WriteString(image); bubbleNotification.WriteInteger(string.IsNullOrEmpty(linkUrl) ? 2 : 3); bubbleNotification.WriteString("display"); bubbleNotification.WriteString("BUBBLE"); bubbleNotification.WriteString("message"); bubbleNotification.WriteString(message); if (string.IsNullOrEmpty(linkUrl)) return bubbleNotification; bubbleNotification.WriteString("linkUrl"); bubbleNotification.WriteString(linkUrl); return bubbleNotification; } public RoomNotificationComposer(string Type) : base(ServerPacketHeader.RoomNotificationMessageComposer) { base.WriteString(Type); base.WriteInteger(0);//Count } } } [/CODE] My packet for RoomNotificationMessageComposer -> 2940 Thnks for your help Have a good day PS: I have see my AboutCommand doesn't work. I think the problem come RoomNotificationComposer [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
EventAlert Command doesn't work
Top