yagalkatrina
New Member
- Jan 1, 2019
- 23
- 17
Does anyone have an users online command for Plus EMU R2 that's released
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using Plus.HabboHotel.Rooms;
using Plus.HabboHotel.Items;
using Plus.Communication.Packets.Outgoing.Inventory.Furni;
using Plus.Database.Interfaces;
using Plus.HabboHotel.Users;
using Plus.HabboHotel.GameClients;
using Plus.Communication.Packets.Outgoing.Notifications;
namespace Plus.HabboHotel.Rooms.Chat.Commands.Moderator
{
class ViewOnlineCommand : IChatCommand
{
public string PermissionRequired => "user_6";
public string Parameters => "";
public string Description => "View Online Users";
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
{
Dictionary<Habbo, UInt32> clients = new Dictionary<Habbo, UInt32>();
StringBuilder content = new StringBuilder();
content.Append("- LIST OF USERS ONLINE -\r\n");
foreach (var client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList())
{
if (client == null)
continue;
content.Append("¥ " + client.GetHabbo().Username + " » Is In Room: " + ((client.GetHabbo().CurrentRoom == null) ? " Not In Room." : client.GetHabbo().CurrentRoom.RoomData.Name) + "\r\n");
}
Session.SendMessage(new MOTDNotificationComposer(content.ToString()));
return;
}
}
}
Thanks.C#:using System; using System.Linq; using System.Text; using System.Collections.Generic; using Plus.HabboHotel.Rooms; using Plus.HabboHotel.Items; using Plus.Communication.Packets.Outgoing.Inventory.Furni; using Plus.Database.Interfaces; using Plus.HabboHotel.Users; using Plus.HabboHotel.GameClients; using Plus.Communication.Packets.Outgoing.Notifications; namespace Plus.HabboHotel.Rooms.Chat.Commands.Moderator { class ViewOnlineCommand : IChatCommand { public string PermissionRequired => "user_6"; public string Parameters => ""; public string Description => "View Online Users"; public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { Dictionary<Habbo, UInt32> clients = new Dictionary<Habbo, UInt32>(); StringBuilder content = new StringBuilder(); content.Append("- LIST OF USERS ONLINE -\r\n"); foreach (var client in PlusEnvironment.GetGame().GetClientManager().GetClients.ToList()) { if (client == null) continue; content.Append("¥ " + client.GetHabbo().Username + " » Is In Room: " + ((client.GetHabbo().CurrentRoom == null) ? " Not In Room." : client.GetHabbo().CurrentRoom.RoomData.Name) + "\r\n"); } Session.SendMessage(new MOTDNotificationComposer(content.ToString())); return; } } }
Change it to ViewOnlineCommand and make sure you have opened the .csproj file and not the Folder itself.Thanks.
Post automatically merged:
I have the problem where in CommandManager.cs where I put in this.Register("online", new OnlineCommand()); the OnlineCommand won't turn light blue like the others
Post automatically merged:
Have I done something wrong or what?
What do you mean by that?Change it to ViewOnlineCommand and make sure you have opened the .csproj file and not the Folder itself.
I worked it out, thanks aha