Bubble Alert

AnalPudding

MySQL Failed to load {motto}
Dec 18, 2017
13
14
Hello everyone i decided to share this with everyone cause i couldnt find any tutorial considering about this.
Lets begin

This works with PlusEmu

1. Create .cs folder. Example AlertCommand.cs

2. Clear everything so there is no coding in the file

3. Paste everything in Spoiler 1 to your cs file (Remember to add the command names)

4. Open Spoiler 2 and copy the text on it. you have to put that in RoomNotificationComposer

5. Get yourself a image that will show in the alert (size 50x50)

6. Place the image in /c_images/notifications/IMAGENAME.png

7. Go in your COMMANDNAME.cs and find row 38 there will be SendBubble("IMAGENAME", message)); Do not put .png behind the name.

8. Go in CommandManager.cs and register the command to the section you want it in. Example: this.Register("COMMANDNAME", new COMMANDNAMECommand());

9. Save everything and debug

10. Go in your database and add the command in there usually table permission_commands

11. Restart emu and clear cache and you are done

using Plus.HabboHotel.Rooms;
using Plus.Communication.Interfaces;
using Plus.Communication.Packets.Outgoing.Rooms.Chat;
using Plus.HabboHotel.GameClients;
using System;
using System.Threading;
using Plus.Communication.Packets.Outgoing.Rooms.Notifications;


namespace Plus.HabboHotel.Rooms.Chat.Commands.Administrator
{
class COMMANDNAMECommand : IChatCommand
{
public string PermissionRequired
{
get { return "command_COMMANDNAME"; }
}

public string Parameters
{
get { return "%message%"; }
}

public string Description
{
get { return "Send bubble alert to whole hotel."; }
}

public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
if (Params.Length == 1)
{
Session.SendWhisper("Need message");
return;
}

string message = CommandManager.MergeParams(Params, 1);
PlusEnvironment.GetGame().GetClientManager().SendMessage(RoomNotificationComposer.SendBubble("IMAGENAME", message));
}
}
}

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;
}

Hopefully this worked for you!

And here is short GIF for you so you can see what its like


Thanks to: Pollak#5428 for helping me to code this.

If you have any questions considering this feel free to add me as friend in Discord: AnalPudding#4578

Anyways have a great day! Goodbye
 

Moonstar

Member
Oct 29, 2013
88
20
In the command SendBubble("IMAGENAME", message));
If your image name is "info" change the "IMAGENAME" to "info" and then put store the image in /c_images/notifications/

Then it should work. Hopefully this worked
nah i had to make the image .png in the emu then name it _png too
 

Users who are viewing this thread

Top