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:
And add this:
Go to HabboHotel/Rooms/Chat/Commands/User and create a new class called "DisableSexCommand.cs".
And add this inside the .cs file:
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:
And below add this:
Go to HabboHotel/Users/Habbo.cs and add this code to line 80.
In the same file we will still look for this code:
And we substitute for this:
In the same file we still look for:
And we add this code below:
In the same file we still look for:
And we add this code below:
Now we go to HabboHotel/Users/Authenticator/HabboFactory/Authenticator.cs, we search for "rank_vip" in this same file and add that behind it.
Let's go to HabboHotel/Users/UserDataManagement/UserDataFactory.cs and look for this:
And behind " `rank_vip` "we added this:
And to finish we look again for this:
And do the same thing we had done before, which is to add allow_sex behind rank_vip.
To conclude with a golden key, run this SQL code:
Now we debug and test.
I'm sorry for my English, I'm Brazilian.
Hugs! :
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());
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();
}
}
}
}
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;
}
Go to HabboHotel/Users/Habbo.cs and add this code to line 80.
Code:
private bool _allowSex;
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)
In the same file we still look for:
Code:
this._allowMimic = AllowMimic;
And we add this code below:
Code:
this._allowSex = AllowSex;
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; }
}
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()),
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"
Code:
`allow_sex`,
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.
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! :