Azure Emu - Custom Commands

KingLegend

head chav
May 17, 2015
96
22
Hey There.

I Am a bit of a noob to Coding #C on the emu side, So could anyone help me with my first custom command?
I'm using Azure Emulator.

Basically, I Want a user to say :welcome x
and it responds with a message, Could you help me?

@JayCustom are you good with this stuff? (Sorry for tagging)
 

JayC

Well-Known Member
Aug 8, 2013
5,505
1,401
This is how you do it in GTE (Never used Azure) maybe its the same?
Open your emulator in VB
Open RoleManager.CS (HabboHotel -> Roles -> RoleManager)
Find where you are adding dictionary_4
Code:
 this.dictionary_4.Add("welcome", 160);
"welcome" is the command name and "160" is the next available number in dictionary_4 (that will be your case number)

Next we open ChatCommandHandler (HabboHotel -> Misc -> ChatCommandHandler)
Code:
if (Session.GetHabbo().HasFuse("cmd_enable"))
{
 text7 = text7 + GoldTreeEnvironment.GetExternalText("cmd_welcome_desc") + "\r\r";
}
I am using the cmd_enable because everyone gets the enable command and its easier for me so I don't have to add more permissions
The text7 is your commands command and it will add the description from your texts in the database
Then just code your command...
You need to test 3 things:
- That user exists in the database
- That user is in the room
- That user registered less than 1 day ago (This is a good feature, so people can't abuse command)
then you just say
Session.GetHabbo().Shout("Welcome to the hotel " + Params[1] + " Hope you enjoy your stay!");
 

Users who are viewing this thread

Top