Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Purchasable Namecolors from Catalog [Plus]

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:

Code:
public string _nameColor;

On the public Habbo void add to the brackets:
Code:
string NameColor
Below the public Habbo void add:
Code:
this._nameColor = NameColor;
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)

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:
( )
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';
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.
 
Last edited:
Junior Spellweaver
Joined
Aug 25, 2016
Messages
100
Reaction score
15
You just need to create a string on Habbo and define it, I think it's perfectly explained on the thread, lol.
It's missing more. That's why i asking to help me with the .cs's files.
Like on InteractionType.cs it's missing private (readonly?) baseItem (don't know which to use).

Btw, ScrSendUserInfoComposer is also missing. We don't have that.
 
Newbie Spellweaver
Joined
Apr 16, 2014
Messages
58
Reaction score
29
I'm pretty sure you have not added the packet references on the top.
Use the little light for dummies by rightclicking, it will recommend you to add an using reference etc.

Sent from my Kappaphone on Barcelona streeterinos.
 
Junior Spellweaver
Joined
Aug 25, 2016
Messages
100
Reaction score
15
@CUS7OM I was missing using Plus.HabboHotel.Users; at the top.

Now i have a annoying error, I can't solve it. Any help?
CUS7OM - Purchasable Namecolors from Catalog [Plus] - RaGEZONE Forums



My ScrSendUserInfoComposer.cs: ( )

using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using Plus.HabboHotel.Users;namespace Plus.Communication.Packets.Outgoing.Users{ class ScrSendUserInfoComposer : ServerPacket { public ScrSendUserInfoComposer() : base(ServerPacketHeader.ScrSendUserInfoMessageComposer) { int DisplayMonths = 0; int DisplayDays = 0; base.WriteString("habbo_club"); base.WriteInteger(DisplayDays); base.WriteInteger(2); base.WriteInteger(DisplayMonths); base.WriteInteger(1); base.WriteBoolean(true); // hc base.WriteBoolean(true); // vip base.WriteInteger(0); base.WriteInteger(0); base.WriteInteger(495); } }}
 
Newbie Spellweaver
Joined
Feb 7, 2017
Messages
8
Reaction score
1
Catalog_items, furnuture sql's and furnidata.xml pls?



This is poop:
 
Newbie Spellweaver
Joined
Feb 9, 2017
Messages
9
Reaction score
0
Catalog_items, furnuture sql's and furnidata.xml pls?



This is poop:

Not need furnidata.xml, only catalog_items and furniture.

I have a question, what page_layout it is from your hotel?
 
Newbie Spellweaver
Joined
Apr 16, 2014
Messages
58
Reaction score
29
Not need furnidata.xml, only catalog_items and furniture.

I have a question, what page_layout it is from your hotel?

Just use the default_3x3 but setup the items like badges so you get that cool effect.

Regards.
 
Back
Top