Status
Not open for further replies.

uttmmmm5

Member
May 18, 2016
110
5
Hey there
The :eventalert :)eha) is nothing else as the normal hotel alert.
Now i have a question about it:
How i can change the eventalert that it haves at the Alert itself a button (Buttontext: Go to Event) and if a user click on this button he automatically follow the User who made this eventalert to the room where he is ?
Btw: the "OK" Button must be there too for these Users they don't want to play this event so they can click the "ok"-Button to close the Alert without any actions are happened and the Users they want play the Event simply click the "Go to Event"-Button to automatically follow.

Best Regards :)
 

Mrmoseby

Active Member
Jul 1, 2016
142
51
Hey there
The :eventalert :)eha) is nothing else as the normal hotel alert.
Now i have a question about it:
How i can change the eventalert that it haves at the Alert itself a button (Buttontext: Go to Event) and if a user click on this button he automatically follow the User who made this eventalert to the room where he is ?
Btw: the "OK" Button must be there too for these Users they don't want to play this event so they can click the "ok"-Button to close the Alert without any actions are happened and the Users they want play the Event simply click the "Go to Event"-Button to automatically follow.

Best Regards :)
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)
{
TimeSpan Cooldown = DateTime.Now - RoomUser.CommandExecuted;
if (Cooldown.Seconds >= 20)
{

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("Hobba 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));
}
}
RoomUser.CommandExecuted = DateTime.Now;
}

else
{
int num = checked(20 - Cooldown.Seconds);
Session.SendWhisper("Cooldown! You must wait " + num + " seconds until you can do that!");

}

}
}
}
 

Bjork

Member
Feb 7, 2012
73
29
Here is the code without the Cooldown, Cooldown is for avoiding spamming the alert.

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("Hobba 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));
}
}
}
}
}
 
Status
Not open for further replies.

Users who are viewing this thread

Top