Color Name Tchat - [PlusEMU]

Twister

New Member
May 24, 2015
29
1
Hello, I'm french so I'm sorry for my English.
I wanted to put a color for staff pseudo on my retroserveur. But I have a problem because, there are a HTML code before the username.
Code on RoomUser.cs
if (GetClient().GetHabbo().Rank == 7)
{
string Username = "<font color='#D900D9'>[G] " + GetClient().GetHabbo().Username + "</font>";
if (GetRoom() != null)
GetRoom().SendMessage(new UserNameChangeComposer(RoomId, VirtualId, Username));
}

if (GetClient().GetHabbo().Rank == 6)
{
Like this:
ffbb8c0aef07447fa89b9cfebb6d494a.png


Thanks you for your help :p
 
UP
 

Brad

Well-Known Member
Jun 5, 2012
2,319
992
Create 2 voids. One being to set their colour name and one to set it back to default.

Call the Colourname before they send the message, then after call the DefaultName void you made.
 

Twister

New Member
May 24, 2015
29
1
Create 2 voids. One being to set their colour name and one to set it back to default.

Call the Colourname before they send the message, then after call the DefaultName void you made.
Can you give me an exemple, I don't all understand :/
@Sle Maybe
 
Last edited:

Seargent David

New Member
Aug 26, 2011
18
0
Room.SendMessage(new UserNameChangeComposer(Room.Id, User.VirtualId, "<font color='#" + color + "'>" + User.GetUsername() + "</font>"));
User.OnChat(User.LastBubble, Message, true, Session, true, false);
Room.SendMessage(new UserNameChangeComposer(Room.Id, User.VirtualId, User.GetUsername()));
 

Twister

New Member
May 24, 2015
29
1
Room.SendMessage(new UserNameChangeComposer(Room.Id, User.VirtualId, "<font color='#" + color + "'>" + User.GetUsername() + "</font>"));
User.OnChat(User.LastBubble, Message, true, Session, true, false);
Room.SendMessage(new UserNameChangeComposer(Room.Id, User.VirtualId, User.GetUsername()));
I'm puting that instaed of my code ?
 

Seargent David

New Member
Aug 26, 2011
18
0
I'm puting that instaed of my code ?
Well that code is working. Just replace the + color with your hexcode (obviously). It works because it sets your username to the font color, then sends a chat message, THEN switches your username back (no color) so it looks normal, rather than having <font in it.
 

Users who are viewing this thread

Top