Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Releases
Server Releases
Coloured Usernames Release [PlusEmu]
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Mikee" data-source="post: 416951" data-attributes="member: 76567"><p>Credits Go To [USER=35321]@Jerry[/USER]</p><p></p><p>Step 1. Make this Command</p><p>[CODE]namespace Plus.HabboHotel.Rooms.Chat.Commands.User</p><p>{</p><p> class ColouredChatCommand : IChatCommand</p><p> {</p><p> public string PermissionRequired => "command_setcolor";</p><p> public string Parameters => "%color%";</p><p> public string Description => "Set your chat color to whatever you want.";</p><p></p><p> public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)</p><p> {</p><p> string colorName = Params[1].ToLower();</p><p></p><p> switch (colorName)</p><p> {</p><p> case "silver":</p><p> {</p><p> Session.GetHabbo().ChatColor = "#C0C0C0";</p><p> Session.SendWhisper($"Your chat color has been set to {colorName}");</p><p> break;</p><p> }</p><p> case "grey":</p><p> case "gray":</p><p> {</p><p> Session.GetHabbo().ChatColor = "#808080";</p><p> Session.SendWhisper($"Your chat color has been set to {colorName}");</p><p> break;</p><p> }</p><p> case "default":</p><p> case "none":</p><p> case "off":</p><p> case "black":</p><p> {</p><p> Session.GetHabbo().ChatColor = "#000000";</p><p> Session.SendWhisper("You have disabled your chat color");</p><p> break;</p><p> }</p><p> case "red":</p><p> {</p><p> Session.GetHabbo().ChatColor = "#FF0000";</p><p> Session.SendWhisper($"Your chat color has been set to {colorName}");</p><p> break;</p><p> }</p><p> case "maroon":</p><p> {</p><p> Session.GetHabbo().ChatColor = "#800000";</p><p> Session.SendWhisper($"Your chat color has been set to {colorName}");</p><p> break;</p><p> }</p><p> case "yellow":</p><p> {</p><p> Session.GetHabbo().ChatColor = "#FFFF00";</p><p> Session.SendWhisper($"Your chat color has been set to {colorName}");</p><p> break;</p><p> }</p><p> case "olive":</p><p> {</p><p> Session.GetHabbo().ChatColor = "#808000";</p><p> Session.SendWhisper($"Your chat color has been set to {colorName}");</p><p> break;</p><p> }</p><p> case "lime":</p><p> {</p><p> Session.GetHabbo().ChatColor = "#00FF00";</p><p> Session.SendWhisper($"Your chat color has been set to {colorName}");</p><p> break;</p><p> }</p><p> case "green":</p><p> {</p><p> Session.GetHabbo().ChatColor = "#008000";</p><p> Session.SendWhisper($"Your chat color has been set to {colorName}");</p><p> break;</p><p> }</p><p> case "aqua":</p><p> {</p><p> Session.GetHabbo().ChatColor = "#00FFFF";</p><p> Session.SendWhisper($"Your chat color has been set to {colorName}");</p><p> break;</p><p> }</p><p> case "teal":</p><p> {</p><p> Session.GetHabbo().ChatColor = "#008080";</p><p> Session.SendWhisper($"Your chat color has been set to {colorName}");</p><p> break;</p><p> }</p><p> case "blue":</p><p> {</p><p> Session.GetHabbo().ChatColor = "#0000FF";</p><p> Session.SendWhisper($"Your chat color has been set to {colorName}");</p><p> break;</p><p> }</p><p> case "navy":</p><p> {</p><p> Session.GetHabbo().ChatColor = "#000080";</p><p> Session.SendWhisper($"Your chat color has been set to {colorName}");</p><p> break;</p><p> }</p><p> case "fuschia":</p><p> {</p><p> Session.GetHabbo().ChatColor = "#FF00FF";</p><p> Session.SendWhisper($"Your chat color has been set to {colorName}");</p><p> break;</p><p> }</p><p> case "purple":</p><p> {</p><p> Session.GetHabbo().ChatColor = "#800080";</p><p> Session.SendWhisper($"Your chat color has been set to {colorName}");</p><p> break;</p><p> }</p><p> default:</p><p> {</p><p> Session.SendWhisper($"The chat color {colorName} does not exist!");</p><p> break;</p><p> }</p><p> }</p><p> }</p><p> }</p><p>}</p><p>[/CODE]</p><p></p><p>Step 2.</p><p></p><p>Find Player Static Values in Habbo.cs</p><p>Below it put this...</p><p>[CODE]public string ChatColor;[/CODE]</p><p></p><p>Step 3.</p><p></p><p>Go to RoomUser.Cs and add this method</p><p>[CODE] public void SendNameColourPacket()</p><p> {</p><p> if (IsBot || GetClient() == null || GetClient().GetHabbo() == null)</p><p> return;</p><p> if (GetClient().GetHabbo().ChatColor == null || GetClient().GetHabbo().ChatColor == String.Empty)</p><p> return;</p><p> if (GetClient().GetHabbo().ChatPreference)</p><p> return;</p><p> string Username = "<font color='" + GetClient().GetHabbo().ChatColor + "'>" + GetClient().GetHabbo().Username + "</font>";</p><p></p><p> if (GetRoom() != null)</p><p> GetRoom().SendPacket(new UserNameChangeComposer(RoomId, VirtualId, Username));</p><p></p><p> }[/CODE]</p><p></p><p>Also add this method</p><p>[CODE] public void SendNamePacket()</p><p> {</p><p> if (IsBot || GetClient() == null || GetClient().GetHabbo() == null)</p><p> return;</p><p></p><p> string Username = GetClient().GetHabbo().Username;</p><p></p><p> if (GetRoom() != null)</p><p> GetRoom().SendPacket(new UserNameChangeComposer(RoomId, VirtualId, Username));</p><p> }[/CODE]</p><p></p><p>Now in that same class replace</p><p>[CODE]</p><p> if (GetClient().GetHabbo().TentId > 0)</p><p> {</p><p> mRoom.SendToTent(GetClient().GetHabbo().Id, GetClient().GetHabbo().TentId, Packet);</p><p></p><p> Packet = new WhisperComposer(this.VirtualId, "[Tent Chat] " + Message, 0, Colour);</p><p></p><p> List<RoomUser> ToNotify = mRoom.GetRoomUserManager().GetRoomUserByRank(2);</p><p></p><p> if (ToNotify.Count > 0)</p><p> {</p><p> foreach (RoomUser user in ToNotify)</p><p> {</p><p> if (user == null || user.GetClient() == null || user.GetClient().GetHabbo() == null ||</p><p> user.GetClient().GetHabbo().TentId == GetClient().GetHabbo().TentId)</p><p> {</p><p> continue;</p><p> }</p><p></p><p> user.GetClient().SendPacket(Packet);</p><p> }</p><p> </p><p> }</p><p> }</p><p> else</p><p> {</p><p></p><p></p><p> foreach (RoomUser User in mRoom.GetRoomUserManager().GetRoomUsers().ToList())</p><p> {</p><p> if (User == null || User.GetClient() == null || User.GetClient().GetHabbo() == null || User.GetClient().GetHabbo().GetIgnores().IgnoredUserIds().Contains(mClient.GetHabbo().Id))</p><p> continue;</p><p></p><p> if (mRoom.chatDistance > 0 && Gamemap.TileDistance(this.X, this.Y, User.X, User.Y) > mRoom.chatDistance)</p><p> continue;</p><p></p><p> User.GetClient().SendPacket(Packet);</p><p> }</p><p></p><p> }[/CODE]</p><p>...</p><p></p><p>With</p><p>[CODE]</p><p> if (GetClient().GetHabbo().TentId > 0)</p><p> {</p><p> mRoom.SendToTent(GetClient().GetHabbo().Id, GetClient().GetHabbo().TentId, Packet);</p><p></p><p> Packet = new WhisperComposer(this.VirtualId, "[Tent Chat] " + Message, 0, Colour);</p><p></p><p> List<RoomUser> ToNotify = mRoom.GetRoomUserManager().GetRoomUserByRank(2);</p><p></p><p> if (ToNotify.Count > 0)</p><p> {</p><p> foreach (RoomUser user in ToNotify)</p><p> {</p><p> if (user == null || user.GetClient() == null || user.GetClient().GetHabbo() == null ||</p><p> user.GetClient().GetHabbo().TentId == GetClient().GetHabbo().TentId)</p><p> {</p><p> continue;</p><p> }</p><p></p><p> user.GetClient().SendPacket(Packet);</p><p> }</p><p> </p><p> }</p><p> }</p><p> else</p><p> {</p><p> SendNameColorPacket();</p><p></p><p> foreach (RoomUser User in mRoom.GetRoomUserManager().GetRoomUsers().ToList())</p><p> {</p><p> if (User == null || User.GetClient() == null || User.GetClient().GetHabbo() == null || User.GetClient().GetHabbo().GetIgnores().IgnoredUserIds().Contains(mClient.GetHabbo().Id))</p><p> continue;</p><p></p><p> if (mRoom.chatDistance > 0 && Gamemap.TileDistance(this.X, this.Y, User.X, User.Y) > mRoom.chatDistance)</p><p> continue;</p><p></p><p> User.GetClient().SendPacket(Packet);</p><p> }</p><p> SendNamePacket();</p><p> }[/CODE]</p></blockquote><p></p>
[QUOTE="Mikee, post: 416951, member: 76567"] Credits Go To [USER=35321]@Jerry[/USER] Step 1. Make this Command [CODE]namespace Plus.HabboHotel.Rooms.Chat.Commands.User { class ColouredChatCommand : IChatCommand { public string PermissionRequired => "command_setcolor"; public string Parameters => "%color%"; public string Description => "Set your chat color to whatever you want."; public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { string colorName = Params[1].ToLower(); switch (colorName) { case "silver": { Session.GetHabbo().ChatColor = "#C0C0C0"; Session.SendWhisper($"Your chat color has been set to {colorName}"); break; } case "grey": case "gray": { Session.GetHabbo().ChatColor = "#808080"; Session.SendWhisper($"Your chat color has been set to {colorName}"); break; } case "default": case "none": case "off": case "black": { Session.GetHabbo().ChatColor = "#000000"; Session.SendWhisper("You have disabled your chat color"); break; } case "red": { Session.GetHabbo().ChatColor = "#FF0000"; Session.SendWhisper($"Your chat color has been set to {colorName}"); break; } case "maroon": { Session.GetHabbo().ChatColor = "#800000"; Session.SendWhisper($"Your chat color has been set to {colorName}"); break; } case "yellow": { Session.GetHabbo().ChatColor = "#FFFF00"; Session.SendWhisper($"Your chat color has been set to {colorName}"); break; } case "olive": { Session.GetHabbo().ChatColor = "#808000"; Session.SendWhisper($"Your chat color has been set to {colorName}"); break; } case "lime": { Session.GetHabbo().ChatColor = "#00FF00"; Session.SendWhisper($"Your chat color has been set to {colorName}"); break; } case "green": { Session.GetHabbo().ChatColor = "#008000"; Session.SendWhisper($"Your chat color has been set to {colorName}"); break; } case "aqua": { Session.GetHabbo().ChatColor = "#00FFFF"; Session.SendWhisper($"Your chat color has been set to {colorName}"); break; } case "teal": { Session.GetHabbo().ChatColor = "#008080"; Session.SendWhisper($"Your chat color has been set to {colorName}"); break; } case "blue": { Session.GetHabbo().ChatColor = "#0000FF"; Session.SendWhisper($"Your chat color has been set to {colorName}"); break; } case "navy": { Session.GetHabbo().ChatColor = "#000080"; Session.SendWhisper($"Your chat color has been set to {colorName}"); break; } case "fuschia": { Session.GetHabbo().ChatColor = "#FF00FF"; Session.SendWhisper($"Your chat color has been set to {colorName}"); break; } case "purple": { Session.GetHabbo().ChatColor = "#800080"; Session.SendWhisper($"Your chat color has been set to {colorName}"); break; } default: { Session.SendWhisper($"The chat color {colorName} does not exist!"); break; } } } } } [/CODE] Step 2. Find Player Static Values in Habbo.cs Below it put this... [CODE]public string ChatColor;[/CODE] Step 3. Go to RoomUser.Cs and add this method [CODE] public void SendNameColourPacket() { if (IsBot || GetClient() == null || GetClient().GetHabbo() == null) return; if (GetClient().GetHabbo().ChatColor == null || GetClient().GetHabbo().ChatColor == String.Empty) return; if (GetClient().GetHabbo().ChatPreference) return; string Username = "<font color='" + GetClient().GetHabbo().ChatColor + "'>" + GetClient().GetHabbo().Username + "</font>"; if (GetRoom() != null) GetRoom().SendPacket(new UserNameChangeComposer(RoomId, VirtualId, Username)); }[/CODE] Also add this method [CODE] public void SendNamePacket() { if (IsBot || GetClient() == null || GetClient().GetHabbo() == null) return; string Username = GetClient().GetHabbo().Username; if (GetRoom() != null) GetRoom().SendPacket(new UserNameChangeComposer(RoomId, VirtualId, Username)); }[/CODE] Now in that same class replace [CODE] if (GetClient().GetHabbo().TentId > 0) { mRoom.SendToTent(GetClient().GetHabbo().Id, GetClient().GetHabbo().TentId, Packet); Packet = new WhisperComposer(this.VirtualId, "[Tent Chat] " + Message, 0, Colour); List<RoomUser> ToNotify = mRoom.GetRoomUserManager().GetRoomUserByRank(2); if (ToNotify.Count > 0) { foreach (RoomUser user in ToNotify) { if (user == null || user.GetClient() == null || user.GetClient().GetHabbo() == null || user.GetClient().GetHabbo().TentId == GetClient().GetHabbo().TentId) { continue; } user.GetClient().SendPacket(Packet); } } } else { foreach (RoomUser User in mRoom.GetRoomUserManager().GetRoomUsers().ToList()) { if (User == null || User.GetClient() == null || User.GetClient().GetHabbo() == null || User.GetClient().GetHabbo().GetIgnores().IgnoredUserIds().Contains(mClient.GetHabbo().Id)) continue; if (mRoom.chatDistance > 0 && Gamemap.TileDistance(this.X, this.Y, User.X, User.Y) > mRoom.chatDistance) continue; User.GetClient().SendPacket(Packet); } }[/CODE] ... With [CODE] if (GetClient().GetHabbo().TentId > 0) { mRoom.SendToTent(GetClient().GetHabbo().Id, GetClient().GetHabbo().TentId, Packet); Packet = new WhisperComposer(this.VirtualId, "[Tent Chat] " + Message, 0, Colour); List<RoomUser> ToNotify = mRoom.GetRoomUserManager().GetRoomUserByRank(2); if (ToNotify.Count > 0) { foreach (RoomUser user in ToNotify) { if (user == null || user.GetClient() == null || user.GetClient().GetHabbo() == null || user.GetClient().GetHabbo().TentId == GetClient().GetHabbo().TentId) { continue; } user.GetClient().SendPacket(Packet); } } } else { SendNameColorPacket(); foreach (RoomUser User in mRoom.GetRoomUserManager().GetRoomUsers().ToList()) { if (User == null || User.GetClient() == null || User.GetClient().GetHabbo() == null || User.GetClient().GetHabbo().GetIgnores().IgnoredUserIds().Contains(mClient.GetHabbo().Id)) continue; if (mRoom.chatDistance > 0 && Gamemap.TileDistance(this.X, this.Y, User.X, User.Y) > mRoom.chatDistance) continue; User.GetClient().SendPacket(Packet); } SendNamePacket(); }[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
Server Releases
Coloured Usernames Release [PlusEmu]
Top