Help with :eha command

Dan3212

Member
Mar 30, 2016
86
10
I'm following this:



I modified EventAlertCommand.cs from:
Code:
using Plus.Communication.Packets.Outgoing.Moderation;
using Plus.HabboHotel.GameClients;
using System;
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 "Send a hotel alert for your event!";
            }
        }
        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().SendPacket(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().SendPacket(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);
                        }
                    }
                }
            }
        }
    }
}

and I changed it to:

Code:
using Plus.Communication.Packets.Outgoing.Rooms.Notifications;
using Plus.HabboHotel.GameClients;
using System;
using Plus.HabboHotel.Users;
using Plus.Database.Interfaces;

namespace Plus.HabboHotel.Rooms.Chat.Commands.Events
{
    internal class EhaCommand : IChatCommand
    {
        public string PermissionRequired
        {
            get
            {
                return "command_eha";
            }
        }
        public string Parameters
        {
            get
            {
                return "%message%";
            }
        }
        public string Description
        {
            get
            {
                return "Send a hotel alert for your event!";
            }
        }
        public void Execute(GameClient Session, Room Room, string[] Params)
        {

            if (Session != null)
            {
                if (Room != null)
                {
                    string Message = "" + "Hey! There's an event going on right now you might want to head down there to win some Hobba Points & prizes!";
                    if (Params.Length > 2)
                        Message = CommandManager.MergeParams(Params, 1);

                    PlusEnvironment.GetGame().GetClientManager().SendMessage(new RoomNotificationComposer("Atomic Events (Supervised)", Message + "\r\n- <b>" + Session.GetHabbo().Username + "</b>\r\n<i></i>", "figure/" + Session.GetHabbo().Username + "", "Go to \"" + Session.GetHabbo().CurrentRoom.Name + "\"!", "event:navigator/goto/" + Session.GetHabbo().CurrentRoomId));
                }
            }
        }
    }
}

It is still doing the regular EHA thats based around a regular hotel alert when im wanting the new layout when a GVIP or Staff member types :eha and displays a alert saying like "Hey theres an event happening right now! Click the button below to go to the event" and theres a button saying "Go to Event".
AND NO COOLDOWN :)

Can someone give me a working code for this?

Btw i'm using Release 2
 

Users who are viewing this thread

Top