using Plus.Communication.Packets.Outgoing.Rooms.Notifications;
using Plus.HabboHotel.GameClients;
namespace Plus.HabboHotel.Rooms.Chat.Commands.Events
{
internal class EventAlertCommand : IChatCommand
{
public string PermissionRequired
{
get
{
return "command_event_alert";
}
}
public string Parameters
{
get
{
return "%message%";
}
}
public string Description
{
get
{
return "Send alert for Events - Game";
}
}
public void Execute(GameClient Session, Room Room, string[] Params)
{
if (Session != null)
{
if (Room != null)
{
if (Params.Length == 1)
{
Session.SendWhisper("Write a message pls.");
return;
}
else
{
string Message = CommandManager.MergeParams(Params, 1);
PlusEnvironment.GetGame().GetClientManager().SendMessage(new RoomNotificationComposer("Messaggio dallo Staff!",
"Il membro dello STAFF <b>" + Session.GetHabbo().Username +
"</b> ti invita all'evento - game che si chiama <b>" + Message +
"</b> <br><br> Clicca il seguente bottone per partecipare:",
"events", "Partecipa!", "event:navigator/goto/" + Session.GetHabbo().CurrentRoomId));
}
}
}
}
/*public void Execute(GameClient Session, Room Room, string[] Params)
{
if (Session != null)
{
if (Room != null)
{
if (Params.Length != 1)
{
Session.SendWhisper("Invalid command! :eventalert", 0);
}
else if (!PlusEnvironment.Event)
{
PlusEnvironment.GetGame().GetClientManager().SendMessage(new BroadcastMessageAlertComposer(":follow " + Session.GetHabbo().Username + " for events! win prizes!\r\n- " + Session.GetHabbo().Username, ""), "");
PlusEnvironment.lastEvent = DateTime.Now;
PlusEnvironment.Event = true;
}
else
{
TimeSpan timeSpan = DateTime.Now - PlusEnvironment.lastEvent;
if (timeSpan.Hours >= 1)
{
PlusEnvironment.GetGame().GetClientManager().SendMessage(new BroadcastMessageAlertComposer(":follow " + Session.GetHabbo().Username + " for events! win prizes!\r\n- " + Session.GetHabbo().Username, ""), "");
PlusEnvironment.lastEvent = DateTime.Now;
}
else
{
int num = checked(60 - timeSpan.Minutes);
Session.SendWhisper("Event Cooldown! " + num + " minutes left until another event can be hosted.", 0);
}
}
}
}
}*/
}
}
PlusEnvironment.GetGame().GetClientManager().SendMessage(new RoomNotificationComposer("Messaggio dallo Staff!",
"Il membro dello STAFF <b>" + Session.GetHabbo().Username +
"</b> ti invita all'evento - game che si chiama <b>" + Message +
"</b> <br><br> Clicca il seguente bottone per partecipare:",
"events", "Partecipa!", "event:navigator/goto/" + Session.GetHabbo().CurrentRoomId));
}
}
}
}
@iaezzz try this
Code:using Plus.Communication.Packets.Outgoing.Rooms.Notifications; using Plus.HabboHotel.GameClients; namespace Plus.HabboHotel.Rooms.Chat.Commands.Events { internal class EventAlertCommand : IChatCommand { public string PermissionRequired { get { return "command_event_alert"; } } public string Parameters { get { return "%message%"; } } public string Description { get { return "Send alert for Events - Game"; } } public void Execute(GameClient Session, Room Room, string[] Params) { if (Session != null) { if (Room != null) { if (Params.Length == 1) { Session.SendWhisper("Write a message pls."); return; } else { string Message = CommandManager.MergeParams(Params, 1); PlusEnvironment.GetGame().GetClientManager().SendMessage(new RoomNotificationComposer("Messaggio dallo Staff!", "Il membro dello STAFF <b>" + Session.GetHabbo().Username + "</b> ti invita all'evento - game che si chiama <b>" + Message + "</b> <br><br> Clicca il seguente bottone per partecipare:", "events", "Partecipa!", "event:navigator/goto/" + Session.GetHabbo().CurrentRoomId)); } } } } /*public void Execute(GameClient Session, Room Room, string[] Params) { if (Session != null) { if (Room != null) { if (Params.Length != 1) { Session.SendWhisper("Invalid command! :eventalert", 0); } else if (!PlusEnvironment.Event) { PlusEnvironment.GetGame().GetClientManager().SendMessage(new BroadcastMessageAlertComposer(":follow " + Session.GetHabbo().Username + " for events! win prizes!\r\n- " + Session.GetHabbo().Username, ""), ""); PlusEnvironment.lastEvent = DateTime.Now; PlusEnvironment.Event = true; } else { TimeSpan timeSpan = DateTime.Now - PlusEnvironment.lastEvent; if (timeSpan.Hours >= 1) { PlusEnvironment.GetGame().GetClientManager().SendMessage(new BroadcastMessageAlertComposer(":follow " + Session.GetHabbo().Username + " for events! win prizes!\r\n- " + Session.GetHabbo().Username, ""), ""); PlusEnvironment.lastEvent = DateTime.Now; } else { int num = checked(60 - timeSpan.Minutes); Session.SendWhisper("Event Cooldown! " + num + " minutes left until another event can be hosted.", 0); } } } } }*/ } }
Small Giude:
1. Open EventAlertCommand.cs and replace the code whit my
2. Save and start whit debug mode
Done, now the command :eventalert or :eha is fix
Edit this in your lenguageCode:PlusEnvironment.GetGame().GetClientManager().SendMessage(new RoomNotificationComposer("Messaggio dallo Staff!", "Il membro dello STAFF <b>" + Session.GetHabbo().Username + "</b> ti invita all'evento - game che si chiama <b>" + Message + "</b> <br><br> Clicca il seguente bottone per partecipare:", "events", "Partecipa!", "event:navigator/goto/" + Session.GetHabbo().CurrentRoomId)); } } } }
Sorry for my bad english but i'm italian
Inviato dal mio iPhone 6s Plus utilizzando Tapatalk.
Thanks for this. I've got one question, how do I make it so it will show the user avatar on the left side of the alert. @mattiagenova
I just downloaded Visual Studios, haven't got a single clue on how to use it.debug?^
Which Project?Open the project in VS , then go to > Habbo Hotel > Rooms > Chat > Commands > Moderator > EventAlertCommand.cs replace the code and hit f5