Mikee
Active Member
- Jul 8, 2017
- 162
- 102
Credits Go To @Jerry
Step 1. Make this Command
Step 2.
Find Player Static Values in Habbo.cs
Below it put this...
Step 3.
Go to RoomUser.Cs and add this method
Also add this method
Now in that same class replace
...
With
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;
}
}
}
}
}
Step 2.
Find Player Static Values in Habbo.cs
Below it put this...
Code:
public string ChatColor;
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));
}
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));
}
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);
}
}
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();
}
Last edited: