Newbie Spellweaver
- Joined
- Apr 16, 2014
- Messages
- 58
- Reaction score
- 29
Hi, I implemented this some months ago and as everyone seems to like it I've decided to share this with everyone on the community, to fulfill the impact that namecolors and tags have on a Hotel, as everyone likes customizing all the possible content.
First step:
Creating all the references.
Go to your Habbo.cs and add:
On the public Habbo void add to the brackets:
Below the public Habbo void add:
Ok, Habbo.cs done, now let's go to Authenticator.cs and add:
(remember you need to set it up on the same position you put the string NameColor on Habbo's void)
Perfect, now all Habbo stuff is done, let's go for the item / catalog related stuff, on PurchaseFromCatalogEvent.cs, add this condition:
(
Now just create the interaction namecolor on InteractionType.cs, add to the enum:
Then add on the switch from below:
Finally, on the packet where you change the username just addapt it:
EG:
So, as you can see I handle the HTML color from the Item.Name, so just name the color you want to add like you wish and go for it. Then, for maximum customization add a proper productdata so you don't have an ugly result.
Do not forget to run this so you add the colum to the users table:
Here's an example from my hotel:
I'll update the badges I designed if you wish later on, now I'm leaving as I'm kinda busy with university. Have a nice day.
Regards, Custom.
First step:
Creating all the references.
Go to your Habbo.cs and add:
Code:
public string _nameColor;
On the public Habbo void add to the brackets:
Code:
string NameColor
Code:
this._nameColor = NameColor;
(remember you need to set it up on the same position you put the string NameColor on Habbo's void)
Code:
Convert.ToString(Row["namecolor"])
Perfect, now all Habbo stuff is done, let's go for the item / catalog related stuff, on PurchaseFromCatalogEvent.cs, add this condition:
(
You must be registered to see links
)
Code:
if (baseItem.InteractionType == InteractionType.namecolor) { if (Item.CostGOTWPoints > Session.GetHabbo().GOTWPoints) return; if (Item.CostGOTWPoints > 0) { Session.GetHabbo().GOTWPoints -= Item.CostGOTWPoints; Session.SendMessage(new HabboActivityPointNotificationComposer(Session.GetHabbo().GOTWPoints, 0, 103)); } using (IQueryAdapter dbClient = QuasarEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.RunQuery("UPDATE `users` SET `namecolor` = '" + Item.Name + "' WHERE `user_id` = '" + Session.GetHabbo().Id + "' LIMIT 1"); } Session.GetHabbo()._nameColor = Item.Name; Session.SendMessage(new ScrSendUserInfoComposer(Session.GetHabbo())); Session.SendMessage(new PurchaseOKComposer(Item, Item.Data)); Session.SendMessage(new FurniListUpdateComposer()); return; }
Now just create the interaction namecolor on InteractionType.cs, add to the enum:
Code:
namecolor,
Then add on the switch from below:
Code:
case "namecolor": return InteractionType.namecolor;
Finally, on the packet where you change the username just addapt it:
EG:
Code:
user.GetClient().SendMessage(new UserNameChangeComposer(mRoom.Id, VirtualId, "<font color=\"#" + GetClient().GetHabbo()._nameColor + "\">" + GetUsername() + "</font>"));
So, as you can see I handle the HTML color from the Item.Name, so just name the color you want to add like you wish and go for it. Then, for maximum customization add a proper productdata so you don't have an ugly result.
Do not forget to run this so you add the colum to the users table:
Code:
ALTER TABLE `users` ADD `namecolor` varchar(125) NOT NULL DEFAULT '000000';
You must be registered to see links
I'll update the badges I designed if you wish later on, now I'm leaving as I'm kinda busy with university. Have a nice day.
Regards, Custom.
Last edited: