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

Gang67

|Jump out gang, we jump out those vehicles|
Messages
303
Likes
45
#1
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: [ To view this link you must register here. ]
How to setup FluxRP Emulator: [ To view this link you must register here. ]
Visual Studio Community 2017: [ To view this link you must register here. ]

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

Opening up the Solution
1. You need to go to your emu file [ [ To view this link you must register here. ] ]
2. Open up the emu file and in it you should see 'Plus.sln' [ [ To view this link you must register here. ] ]
It will take some time to open, just wait!
When it is fully loaded it should look like this: [ [ To view this link you must register here. ] ] (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 [ [ To view this link you must register here. ] ]
2. Inside the HabboHotel folder there should then be a 'Misc' folder, open it up by double clicking it [ [ To view this link you must register here. ] ]
3. Inside the Misc folder there should be a class (.cs) file called 'ChatCommandHandler', open it up by double clicking it [ [ To view this link you must register here. ] ]

ALTERNATIVE


Search for 'ChatCommandHandler' inside the search box [ [ To view this link you must register here. ] ]

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 [ [ To view this link you must register here. ] ]
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 [ [ To view this link you must register here. ] ]
We will be focusing on the section that says case "[command]": [ [ To view this link you must register here. ] ]
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 [ [ To view this link you must register here. ] ]

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 [ [ To view this link you must register here. ] ]:

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 [ [ To view this link you must register here. ] ]
Allow it to debug for about 10 seconds then you can stop the debugging [ [ To view this link you must register here. ] ]
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): [ To view this link you must register here. ]
Credits to those who provided the FluxRP Files (@HendeR)
-Abdi





 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top