[RP/ROLEPLAY] HOW TO EDIT COMMANDS IN THE EMU

Gang67

|Jump out gang, we jump out those vehicles|
May 5, 2017
303
54
Explanation
I'm sure there are plenty of other tutorials on how to do this and I'm sure most people already know how to do this but some people don't. This may not be the best tutorial but I would just like to help any new people to the community. I will be using the flux files which many people currently use. If you have any issues then please comment below and I will help you out. I am using Visual Studio 2017 in this tutorial and it will be similar to other versions which you may be using. You may need some knowledge on C# depending on what you would like to do but you can learn by online tutorials.
Requirements/Downloads
FluxRP Emulator:
How to setup FluxRP Emulator:
Visual Studio Community 2017:

Setting up Visual Studio
1. When you install the installer you should be prompted with this screen [ ] you must ensure that the '.NET desktop development' box is ticked. [ ]
2. Click the install button in the bottom right [ ] (I already have it so it says Close for me)

Opening up the Solution
1. You need to go to your emu file [ ]
2. Open up the emu file and in it you should see 'Plus.sln' [ ]
It will take some time to open, just wait!
When it is fully loaded it should look like this: [ ] (May be a different colour)


Commands aren't just based inside the same files, some commands use timers which are based in a different folder. For now on you should only be editing commands and adding very small commands which don't involve things such as timers if you're new to this/C#. This may not be the best description as I myself is quite new to all this!
1. On the right hand side you should see loads of folders, you need to open up 'HabboHotel' by double clicking it [ ]
2. Inside the HabboHotel folder there should then be a 'Misc' folder, open it up by double clicking it [ ]
3. Inside the Misc folder there should be a class (.cs) file called 'ChatCommandHandler', open it up by double clicking it [ ]

ALTERNATIVE


Search for 'ChatCommandHandler' inside the search box [ ]

Editing Commands (Little C# Lesson)

Firstly, as I mentioned before I am still learning myself so the things I may say some of you pros may know a better way of doing stuff etc. But just remember I am new myself, thank you.

To search through the file you can do [CTRL + F] and enter what you would like to search [ ]
Summary: To add a new way to say the command you use the case "": function, a good way of looking at it is as an if statement. So, case ("cmnds") would be like saying if the user enters cmnds


You can add/remove ways to say the commands. For example for the command :stun, we could also add another way to say it by saying :taser and it'd do the same thing
To do this you need to firstly, find the command you want to edit. For this example I will be using :commands [ ]
We will be focusing on the section that says case "[command]": [ ]
If I would like to add another way to say :commands I could add something such as :cmnds, to do this I would add a new case below the current ones
This is the original:
Code:
               #region :commands (INCOMPLETE)
                case "commands":
                case "cmds":


This is my edit to add the ability to add :cmnds [ ]

Code:
               #region :commands (INCOMPLETE)
                case "commands":
                case "cmds":
                case "cmnds":

When you're doing this do not forgot to add the speech marks and also the colon at the end
If statements are used to make programs robust (not break-able) so for example if I had a user in cuffs, without IF statements the user would be able to still walk and anyone would be able to cuff anyone, whether they're stunned or not.

What this means [ ]:

Code:
                        bool isclose = false;
means 'The user is not close'

Code:
                        if (!JobManager.validJob(Session.GetRoleplay().JobId, Session.GetRoleplay().JobRank))
means 'If the users Job is not the valid job id'
Code:
 Session.SendWhisper("Your job cannot do this!", false, 34);
means 'Send the user a whisper saying "Your job cannot do this" '
Code:
  if (!Session.GetRoleplay().JobHasRights("police")
                            && !Session.GetRoleplay().JobHasRights("gov")
                            && !Session.GetRoleplay().JobHasRights("swat"))
                            Session.SendWhisper("Your job cannot do this!");
means 'If the session does not have Job Rights (police) and/or does not have job rights (gov) and/or doesnt have job rights (swat), send the user a whisper saying "Your job cannot do this!"
Debugging
You can not just simply save the emu file and expect it to update, you must start debugging. This is very easy. To do this you need to click 'Start' in the top bar [ ]
Allow it to debug for about 10 seconds then you can stop the debugging [ ]
If you have an error it will not allow you to debug. Also if you try editing the code while you're debugging at the same time it wont let you. As well as if you try debugging whilst your original emu is open you'll recieve an error

This isn't the best of content as it doesn't provide how to add commands etc. If you would like more detail, please comment exactly what you would like to know! Thank you.
Previous thread (How to make a Habbo RP):
Credits to those who provided the FluxRP Files (@HendeR)
-Abdi





 

Zorreguieta

New Member
Jan 29, 2020
11
7
Hi, I had a question about the debugging process

When I open a file and try to debug it says this isn't possible. I first need to open a file which can be debugged or run. While I'm already in the file I just changed and want to debug

Any1 who can help?
 

Shxrty

Shorty#1960
Mar 31, 2018
629
163
Hi, I had a question about the debugging process

When I open a file and try to debug it says this isn't possible. I first need to open a file which can be debugged or run. While I'm already in the file I just changed and want to debug

Any1 who can help?

Private Message me, but make sure you are opening the .sln file.
 

Zorreguieta

New Member
Jan 29, 2020
11
7
Private Message me, but make sure you are opening the .sln file.
Thanks for your reply,

I can't message you because I don't have 25 posts yet. But if I try to open the .sln file I see this


When I try to open another file after doing that, I still can't debug things I editted :/

May sound a bit noob but I just started using VScode and don't know how to fix this
Post automatically merged:

 
Last edited:

Karel

Member
May 15, 2019
80
13
Haha you can't use visual studio code for this. You will need to install visual studio 2019 and open the .sln file in that :)
 

Users who are viewing this thread

Top