EventAlent Command Anyone help me to coding this command

iaezzz

New Member
Apr 27, 2016
16
1
When users Click button and going to room. EventAlent command


Base EventAlent popup on EmuPlus
You must be registered for see images attach


to do like this
You must be registered for see images attach



I'm using EmuPlus. Help me plz
 
Last edited:

mattiagenova

New Member
Jun 22, 2016
4
3
@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 lenguage
Code:
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 :p

Inviato dal mio  iPhone 6s Plus utilizzando Tapatalk.
 
Last edited:

Supermario

Member
Jan 5, 2016
99
0
@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 lenguage
Code:
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 :p

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
 

Sly

I don't break the rules I bend them.
Oct 28, 2016
246
38
Open the project in VS , then go to > Habbo Hotel > Rooms > Chat > Commands > Moderator > EventAlertCommand.cs replace the code and hit f5
Which Project?
 
I press F5 NOTHING happens
 
The start debugging is greyed-out on F5
 
Thankyou, issue has been resolved. Please do not reply back
 

SOUL

┼ ┼ ┼
Nov 10, 2015
224
45
Which Project?
 
I press F5 NOTHING happens
 
The start debugging is greyed-out on F5
 
Thankyou, issue has been resolved. Please do not reply back

13737ba4ad784d53a229ed2b0b3fba8c.png
 

Users who are viewing this thread

Top