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!

[PlusEmu] Disable Command Sex

Status
Not open for further replies.
Newbie Spellweaver
Joined
Nov 2, 2013
Messages
18
Reaction score
7
Hello everyone, soon they launched the sex command, but they launched anyway with no way to disable it or something, so I decided to create a way to disable it, after the user has disabled the command and it restarts its Client will not need to rewrite the command again because it will already be disabled, to revert and reuse the sex command normally as before just use the same command that used to disable it.

OBS: In spoilers they have printscreens.

To begin, open the file "Plus Emulator.sln".

Open the CommandManager file, which is located at:
HabboHotel/Rooms/Chat/Commands/CommandManager.cs
Look for this:

Code:
private void RegisterUser()        

{

And add this:
Code:
this.Register("disablesex", new DisableSexCommand());

Bet4 - [PlusEmu] Disable Command Sex - RaGEZONE Forums

Go to HabboHotel/Rooms/Chat/Commands/User and create a new class called "DisableSexCommand.cs".
And add this inside the .cs file:

Code:
using Plus.Database.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Plus.HabboHotel.Rooms.Chat.Commands.User{

    class DisableSexCommand : IChatCommand
    {
        public string PermissionRequired
        {
            get { return "command_disable_sex"; }
        }        public string Parameters

        {
            get { return ""; }
        }        public string Description

        {
            get { return "Enables or disables the sex command."; }
        }      


  public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            Session.GetHabbo().AllowSex = !Session.GetHabbo().AllowSex;
            Session.SendWhisper("You " + (Session.GetHabbo().AllowSex == true ? "allows" : "does not allow") + " the sex command.");

            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("UPDATE `users` SET `allow_sex` = [USER=1333418664]Allow[/USER]Sex WHERE `id` = '" +
Session.GetHabbo().Id + "'");
                dbClient.AddParameter("AllowSex", 

PlusEnvironment.BoolToEnum(Session.GetHabbo().AllowSex));
                dbClient.RunQuery();
            }
        }
    }
}

Bet4 - [PlusEmu] Disable Command Sex - RaGEZONE Forums

Go to the file of your command .cs sex that is in:
HabboHotel/Rooms/Chat/Commands/User/Fun
For example mine is "SexCommand.cs".
Search for:

Code:
public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) 

       {  
          if (Params.Length == 1)            

           { 
   
            Session.SendWhisper("Enter the username of the person with whom you want to have sex.");              
            return;   
   
           }


And below add this:

Code:
if (!TargetUser.GetClient().GetHabbo().AllowSex && !Session.GetHabbo().GetPermissions().HasRight("sex"))   

         {
                Session.SendWhisper("Oops, this user has disabled the sex command!");
                return;
            }

Bet4 - [PlusEmu] Disable Command Sex - RaGEZONE Forums

Go to HabboHotel/Users/Habbo.cs and add this code to line 80.

Code:
private bool _allowSex;

Bet4 - [PlusEmu] Disable Command Sex - RaGEZONE Forums

In the same file we will still look for this code:

Code:
int GOTWPoints, bool IgnoreInvites, double TimeMuted, double TradingLock, bool AllowGifts, int FriendBarState, bool DisableForcedEffects, bool AllowMimic, int VIPRank)

And we substitute for this:

Code:
int GOTWPoints, bool IgnoreInvites, double TimeMuted, double TradingLock, bool AllowGifts, int FriendBarState, bool DisableForcedEffects, bool AllowMimic, bool AllowSex, int VIPRank)

Bet4 - [PlusEmu] Disable Command Sex - RaGEZONE Forums

In the same file we still look for:

Code:
this._allowMimic = AllowMimic;

And we add this code below:

Code:
this._allowSex = AllowSex;

Bet4 - [PlusEmu] Disable Command Sex - RaGEZONE Forums
In the same file we still look for:
Code:
public bool AllowMimic        

          { 

           get { return this._allowMimic; }           
           set { this._allowMimic = value; } 

       }

And we add this code below:

Code:
public bool AllowSex        

         {

            get { return this._allowSex; }   

            set { this._allowSex = value; } 

       }

Bet4 - [PlusEmu] Disable Command Sex - RaGEZONE Forums

Now we go to HabboHotel/Users/Authenticator/HabboFactory/Authenticator.cs, we search for "rank_vip" in this same file and add that behind it.

Code:
PlusEnvironment.EnumToBool(Row["allow_sex"].ToString()),

Bet4 - [PlusEmu] Disable Command Sex - RaGEZONE Forums

Let's go to HabboHotel/Users/UserDataManagement/UserDataFactory.cs and look for this:

Code:
"SELECT `id`,`username`,`rank`,`motto`,`look`,`gender`,`last_online`,`credits`,`activity_points`,`home_room`,`block_newfriends`,`hide_online`,`hide_inroom`,`vip`,`account_created`,`vip_points`,`machine_id`,`volume`,`chat_preference`,`focus_preference`, `pets_muted`,`bots_muted`,`advertising_report_blocked`,`last_change`,`gotw_points`,`ignore_invites`,`time_muted`,`allow_gifts`,`friend_bar_state`,`disable_forced_effects`,`allow_mimic`,`allow_sex`,`rank_vip` FROM `users` WHERE `auth_ticket` = @sso LIMIT 1"
And behind " `rank_vip` "we added this:
Code:
`allow_sex`,

Bet4 - [PlusEmu] Disable Command Sex - RaGEZONE Forums

And to finish we look again for this:

Code:
SELECT `id`,`username`,`rank`,`motto`,`look`,`gender`,`last_online`,`credits`,`activity_points`,`home_room`,`block_newfriends`,`hide_online`,`hide_inroom`,`vip`,`account_created`,`vip_points`,`machine_id`,`volume`,`chat_preference`, `focus_preference`, `pets_muted`,`bots_muted`,`advertising_report_blocked`,`last_change`,`gotw_points`,`ignore_invites`,`time_muted`,`allow_gifts`,`friend_bar_state`,`disable_forced_effects`,`allow_mimic`,`rank_vip` FROM `users` WHERE `id` = [USER=19862]id[/USER] LIMIT 1"

And do the same thing we had done before, which is to add allow_sex behind rank_vip.

Bet4 - [PlusEmu] Disable Command Sex - RaGEZONE Forums
To conclude with a golden key, run this SQL code:
Code:
ALTER TABLE `users`ADD COLUMN `allow_sex` ENUM('0','1') NOT NULL DEFAULT '1' AFTER `allow_mimic`;

Now we debug and test.

I'm sorry for my English, I'm Brazilian.

Hugs! :):
 
Joined
Apr 30, 2007
Messages
2,337
Reaction score
1,547
or you just do the simple thing and not add a command that basically promotes rape

In my RP emulator it's possible to get married and have sex only with the person you're married to. It's amusing to watch, however with the phrases I typed for the intercourse itself, I felt quite dirty.
In saying that, it's still funny as hell to see people getting arrested on a roleplay for indecent exposure.
 
◝(⁰▿⁰)◜Smile◝ (⁰▿⁰)◜
Developer
Joined
May 29, 2007
Messages
2,167
Reaction score
898
Closed due to obvious reasons, I don't want it to escalate between 13yo's. Thanks for the fix tough.
 
  • Like
Reactions: pel
Status
Not open for further replies.
Back
Top