Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Releases
Server Releases
[PlusEMU] Jail System
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="SOUL" data-source="post: 409057" data-attributes="member: 64122"><p style="text-align: center"><span style="font-size: 12px"> </span></p> <p style="text-align: center"><span style="font-size: 12px"></span></p> <p style="text-align: center"><span style="font-size: 12px"><img src="https://habbo.md/images/logos/f35c477381a5cabdce6848d56a66385c/be7e2d29b7398d790345068bf3c5d316/cb768f.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /> </span></p><p><span style="font-size: 12px"></span></p><p><span style="font-size: 12px"></span></p><p><span style="font-size: 12px">Yo,</span></p><p><span style="font-size: 12px">Releasing this as thought it would be a nice share anyhow...</span></p><p></p><p><span style="font-family: 'Arial'"><span style="font-size: 15px"><strong>How does this work?</strong></span></span></p><p><span style="font-size: 12px">Upon the user executing command in the format :jail username time the TargetClient will be sent to jail to the given time. A timer is then activated & disposed upon disconnection / completion of the timer.</span></p><p><span style="font-size: 12px">The user cannot talk , leave the room , use the navigator , follow their friends nor message their friends until their timer is completed</span></p><p><span style="font-size: 12px"></span></p><p><span style="font-size: 12px"></span></p><p><span style="font-size: 15px"><strong>Why the fuck are you storing it in the DB?</strong></span></p><p><span style="font-size: 12px">This was done a while ago keep in mind caching also uses a bit of RAM & CPU Usage , although thats no excuse to store it in the database rather than in memory.</span></p><p><span style="font-size: 12px">Not going to fix what ain't broken , in regards to your MySQL server this will put slight strain on it but not to any extent where it's going to damage or slow down your MySQL server so disregard any bullshit comments in regards to this.</span></p><p></p><p></p><p></p><p><span style="font-size: 15px"><strong>Adding this to PlusEMU</strong></span></p><p><span style="font-size: 15px"></span></p><p>[SPOILER]</p><p><strong>Run both of these SQLS</strong></p><p>[CODE]ALTER TABLE `users` ADD `in_jail` int(11) NOT NULL</p><p>ALTER TABLE `users` ADD `jail_time` int(11) NOT NULL[/CODE]</p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>Go to Habbo.cs and find private int _id; under this put </strong></span></p><p>[CODE]public Timer JailTimer;[/CODE]</p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>At the top of Habbo.cs put</strong> </span></p><p>[CODE]using System.Timers;</p><p>[/CODE]</p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>Find private int _friendCount; under this put</strong></span></p><p>[CODE]private int _jail_time;</p><p>private int _in_jail;[/CODE]</p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>Next find</strong></span></p><p>[CODE] public Habbo(int Id, string Username, int Rank, string Motto, string Look, string Gender, int Credits, int ActivityPoints, int HomeRoom,</p><p> bool HasFriendRequestsDisabled, int LastOnline, bool AppearOffline, bool HideInRoom, double CreateDate, int Diamonds,</p><p> string machineID, string clientVolume, bool ChatPreference, bool FocusPreference, bool PetsMuted, bool BotsMuted, bool AdvertisingReportBlocked, double LastNameChange,</p><p> int GOTWPoints, bool IgnoreInvites, double TimeMuted, double TradingLock, bool AllowGifts, int FriendBarState, bool DisableForcedEffects, bool AllowMimic, int VIPRank)[/CODE]</p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>At the end add </strong></span></p><p><span style="font-size: 15px">[CODE],int In_Jail, int Jail_Time[/CODE]</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>Under the { add </strong></span></p><p>[CODE]this._jail_time = Jail_Time;</p><p>this._in_jail = In_Jail;[/CODE]</p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>Find </strong></span></p><p><span style="font-size: 15px">[CODE]public int Id</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> get { return this._id; }</span></p><p><span style="font-size: 15px"> set { this._id = value; }</span></p><p><span style="font-size: 15px"> }[/CODE]</span></p><p><span style="font-size: 15px"><strong>Under this add</strong></span></p><p><span style="font-size: 15px">[CODE] public int Jail_Time</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> get { return this._jail_time; }</span></p><p><span style="font-size: 15px"> set { this._jail_time = value; }</span></p><p><span style="font-size: 15px"> }</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> public int In_Jail</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> get { return this._in_jail; }</span></p><p><span style="font-size: 15px"> set { this._in_jail = value; }</span></p><p><span style="font-size: 15px"> }[/CODE]</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>Then find </strong></span></p><p><span style="font-size: 15px">[CODE] public string GetQueryString</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> get</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> this._habboSaved = true;</span></p><p><span style="font-size: 15px"> return "UPDATE `users` SET `online` = '0', `last_online` = '" + PlusEnvironment.GetUnixTimestamp() + "', `activity_points` = '" + this.Duckets + "', `credits` = '" + this.Credits + "', `in_jail` = '" + this.In_Jail + "', `jail_time` = '" + this.Jail_Time + "', `vip_points` = '" + this.Diamonds + "', `home_room` = '" + this.HomeRoom + "', `gotw_points` = '" + this.GOTWPoints + "', `time_muted` = '" + this.TimeMuted + "',`friend_bar_state` = '" + FriendBarStateUtility.GetInt(this._friendbarState) + "' WHERE id = '" + Id + "' LIMIT 1;UPDATE `user_stats` SET `roomvisits` = '" + this._habboStats.RoomVisits + "', `onlineTime` = '" + (PlusEnvironment.GetUnixTimestamp() - SessionStart + this._habboStats.OnlineTime) + "', `respect` = '" + this._habboStats.Respect + "', `respectGiven` = '" + this._habboStats.RespectGiven + "', `giftsGiven` = '" + this._habboStats.GiftsGiven + "', `giftsReceived` = '" + this._habboStats.GiftsReceived + "', `dailyRespectPoints` = '" + this._habboStats.DailyRespectPoints + "', `dailyPetRespectPoints` = '" + this._habboStats.DailyPetRespectPoints + "', `AchievementScore` = '" + this._habboStats.AchievementPoints + "', `quest_id` = '" + this._habboStats.QuestID + "', `quest_progress` = '" + this._habboStats.QuestProgress + "', `groupid` = '" + this._habboStats.FavouriteGroupId + "',`forum_posts` = '" + this._habboStats.ForumPosts + "' WHERE `id` = '" + this.Id + "' LIMIT 1;";</span></p><p><span style="font-size: 15px"> }</span></p><p><span style="font-size: 15px"> }[/CODE]</span></p><p><span style="font-size: 15px"><strong>And replace it with</strong></span></p><p><span style="font-size: 15px">[CODE] public string GetQueryString</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> get</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> this._habboSaved = true;</span></p><p><span style="font-size: 15px"> return "UPDATE `users` SET `online` = '0', `last_online` = '" + PlusEnvironment.GetUnixTimestamp() + "', `activity_points` = '" + this.Duckets + "', `credits` = '" + this.Credits + "', `in_jail` = '" + this.In_Jail + "', `jail_time` = '" + this.Jail_Time + "', `vip_points` = '" + this.Diamonds + "', `home_room` = '" + this.HomeRoom + "', `gotw_points` = '" + this.GOTWPoints + "', `time_muted` = '" + this.TimeMuted + "',`friend_bar_state` = '" + FriendBarStateUtility.GetInt(this._friendbarState) + "' WHERE id = '" + Id + "' LIMIT 1;UPDATE `user_stats` SET `roomvisits` = '" + this._habboStats.RoomVisits + "', `onlineTime` = '" + (PlusEnvironment.GetUnixTimestamp() - SessionStart + this._habboStats.OnlineTime) + "', `respect` = '" + this._habboStats.Respect + "', `respectGiven` = '" + this._habboStats.RespectGiven + "', `giftsGiven` = '" + this._habboStats.GiftsGiven + "', `giftsReceived` = '" + this._habboStats.GiftsReceived + "', `dailyRespectPoints` = '" + this._habboStats.DailyRespectPoints + "', `dailyPetRespectPoints` = '" + this._habboStats.DailyPetRespectPoints + "', `AchievementScore` = '" + this._habboStats.AchievementPoints + "', `quest_id` = '" + this._habboStats.QuestID + "', `quest_progress` = '" + this._habboStats.QuestProgress + "', `groupid` = '" + this._habboStats.FavouriteGroupId + "',`forum_posts` = '" + this._habboStats.ForumPosts + "' WHERE `id` = '" + this.Id + "' LIMIT 1;";</span></p><p><span style="font-size: 15px"> }</span></p><p><span style="font-size: 15px"> }[/CODE]</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>Find</strong> </span></p><p><span style="font-size: 15px">[CODE] public void InitInformation(UserData data)</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> BadgeComponent = new BadgeComponent(this , data);</span></p><p><span style="font-size: 15px"> Relationships = data.Relations;</span></p><p><span style="font-size: 15px"> }[/CODE]</span></p><p><span style="font-size: 15px"><strong>Under this insert</strong></span></p><p><span style="font-size: 15px">[CODE]internal void StartJailTimer(GameClient Session, int Time)</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> Timer JailTimer = new Timer((Time * 60) * 1000);</span></p><p><span style="font-size: 15px"> JailTimer.Start();</span></p><p><span style="font-size: 15px"> Session.GetHabbo().In_Jail = 1;</span></p><p><span style="font-size: 15px"> JailTimer.Elapsed += (o, e) =></span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> Session.GetHabbo().PrepareRoom(0, "");</span></p><p><span style="font-size: 15px"> Session.SendMessage(new RoomNotificationComposer("Notification",</span></p><p><span style="font-size: 15px"> " You've been released from jail! \n\n" +</span></p><p><span style="font-size: 15px"> " Next time behave yourself!!", "small", ""));</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> Session.GetHabbo().In_Jail = 0;</span></p><p><span style="font-size: 15px"> dbClient.SetQuery("UPDATE `users` SET `jail_time` = @jail_time, `in_jail` = @in_jail, `home_room` = @home_room WHERE id = @id");</span></p><p><span style="font-size: 15px"> dbClient.AddParameter("jail_time", 0);</span></p><p><span style="font-size: 15px"> dbClient.AddParameter("in_jail", 0);</span></p><p><span style="font-size: 15px"> dbClient.AddParameter("home_room", 0);</span></p><p><span style="font-size: 15px"> dbClient.AddParameter("id", Session.GetHabbo().Id);</span></p><p><span style="font-size: 15px"> dbClient.RunQuery();</span></p><p><span style="font-size: 15px"> }</span></p><p><span style="font-size: 15px"> JailTimer.Dispose();</span></p><p><span style="font-size: 15px"> }</span></p><p><span style="font-size: 15px"> ;[/CODE]</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>Okay we're done with this class , now go to Authenticator.cs</strong></span></p><p><span style="font-size: 15px">Change Convert.ToInt32(Row["rank_vip"])); to Convert.ToInt32(Row["rank_vip"]), and add the following code next to it</span></p><p><span style="font-size: 15px">[CODE] Convert.ToInt32(Row["in_jail"]), Convert.ToInt32(Row["jail_time"]));[/CODE]</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>Go to UserDataFactory.cs & Find</strong></span></p><p></p><p><span style="font-size: 15px">[CODE]dbClient.SetQuery("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 `auth_ticket` = @sso LIMIT 1");</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> dbClient.AddParameter("sso", SessionTicket);[/CODE]</span></p><p><span style="font-size: 15px">And replace with </span></p><p><span style="font-size: 15px">[CODE]dbClient.SetQuery("SELECT `id`,`username`,`rank`,`jail_time`,`in_jail`,`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 `auth_ticket` = @sso LIMIT 1");</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> dbClient.AddParameter("sso", SessionTicket);[/CODE]</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>Find</strong></span></p><p><span style="font-size: 15px">[CODE] using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> dbClient.SetQuery("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` = @id LIMIT 1");</span></p><p><span style="font-size: 15px"> dbClient.AddParameter("id", UserId);[/CODE]</span></p><p><span style="font-size: 15px">Replace with </span></p><p><span style="font-size: 15px">[CODE] using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> dbClient.SetQuery("SELECT `id`,`username`,`rank`,`motto`,`jail_time`,`in_jail`,`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` = @id LIMIT 1");</span></p><p><span style="font-size: 15px"> dbClient.AddParameter("id", UserId);[/CODE]</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>Go to HabboHotel > Rooms > Chat > Commands > Administrator </strong></span></p><p><span style="font-size: 15px">Right click then click "Add new class" and call it JailUserCommand</span></p><p><span style="font-size: 15px">Delete everything in the current class and replace it with</span></p><p><span style="font-size: 15px">[CODE]using Plus.Communication.Packets.Outgoing.Rooms.Notifications;</span></p><p><span style="font-size: 15px">using Plus.Database.Interfaces;</span></p><p><span style="font-size: 15px">using Plus.HabboHotel.GameClients;</span></p><p><span style="font-size: 15px">using System;</span></p><p><span style="font-size: 15px">using System.Collections.Generic;</span></p><p><span style="font-size: 15px">using System.Linq;</span></p><p><span style="font-size: 15px">using System.Text;</span></p><p><span style="font-size: 15px">using System.Threading.Tasks;</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px">namespace Plus.HabboHotel.Rooms.Chat.Commands.Administrator</span></p><p><span style="font-size: 15px">{</span></p><p><span style="font-size: 15px"> class JailUserCommand : IChatCommand</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> public string PermissionRequired => "command_jail";</span></p><p><span style="font-size: 15px"> public string Parameters => "%username% %time%";</span></p><p><span style="font-size: 15px"> public string Description => "Put a user in jail!.";</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> int Time = 0;</span></p><p><span style="font-size: 15px"> int Time_Now;</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> Time_Now = Time;</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> if (Params.Length == 1)</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> Session.SendWhisper("Please enter the username of the user you wish to jail");</span></p><p><span style="font-size: 15px"> return;</span></p><p><span style="font-size: 15px"> }</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);</span></p><p><span style="font-size: 15px"> if (TargetClient == null)</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> Session.SendWhisper($"An error occoured whilst trying to find {Params[1]}!");</span></p><p><span style="font-size: 15px"> return;</span></p><p><span style="font-size: 15px"> }</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> RoomUser TargetUser = Room.GetRoomUserManager().GetRoomUserByHabbo(TargetClient.GetHabbo().Id);</span></p><p><span style="font-size: 15px"> if (TargetUser == null)</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> Session.SendWhisper($"An error occoured whilst trying to find {Params[1]}, maybe they're not online or in this room.");</span></p><p><span style="font-size: 15px"> return;</span></p><p><span style="font-size: 15px"> }</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> if (TargetClient.GetHabbo().Rank > Session.GetHabbo().Rank)</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> Session.SendWhisper("Oops , it appears you can't jail this user!");</span></p><p><span style="font-size: 15px"> return;</span></p><p><span style="font-size: 15px"> }</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> if (Session.GetHabbo().In_Jail == 1)</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> Session.SendWhisper($"Oops , it appears {Params[1]} is already jailed!");</span></p><p><span style="font-size: 15px"> return;</span></p><p><span style="font-size: 15px"> }</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> if (Session == TargetClient)</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> Session.SendWhisper("You can't put yourself in jail!");</span></p><p><span style="font-size: 15px"> return;</span></p><p><span style="font-size: 15px"> }</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> if (Int32.TryParse(Params[2], out Time))</span></p><p><span style="font-size: 15px"> {</span></p><p> <span style="font-size: 15px"></span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> Session.SendWhisper($"You have successfully jailed {Params[1]} for {Time} minutes!");</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> TargetClient.GetHabbo().PrepareRoom(// put room id of jail here // , "");</span></p><p><span style="font-size: 15px"> TargetClient.GetHabbo().StartJailTimer(TargetClient, Time);</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> TargetClient.SendMessage(new RoomNotificationComposer("Notification",</span></p><p><span style="font-size: 15px"> " You've been jailed by " + $"{Params[1]}\n\n" +</span></p><p><span style="font-size: 15px"> " You've been jailed for " + $"{Time} " + "Minute(s)", "small", ""));</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> dbClient.SetQuery("UPDATE `users` SET `jail_time` = @jail_time, `in_jail` = @in_jail, `home_room` = @home_room WHERE id = @id");</span></p><p><span style="font-size: 15px"> dbClient.AddParameter("jail_time", Params[2]);</span></p><p><span style="font-size: 15px"> dbClient.AddParameter("in_jail", 1);</span></p><p><span style="font-size: 15px"> dbClient.AddParameter("home_room", // your room id here //);</span></p><p><span style="font-size: 15px"> dbClient.AddParameter("id", TargetClient.GetHabbo().Id);</span></p><p><span style="font-size: 15px"> dbClient.RunQuery();</span></p><p><span style="font-size: 15px"> }</span></p><p><span style="font-size: 15px"> }</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> }</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> }</span></p><p><span style="font-size: 15px">}</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px">[/CODE]</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>Navigate to the following classes , "ShoutEvent" "WhisperEvent" "ChatEvent"</strong></span></p><p><span style="font-size: 15px">In each class insert the following code somewhere</span></p><p><span style="font-size: 15px">[CODE]if (Session.GetHabbo().In_Jail == 1)</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> Session.SendWhisper("You can't talk whilst you're in jail!");</span></p><p><span style="font-size: 15px"> return;</span></p><p><span style="font-size: 15px"> }[/CODE]</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>Go to SendMsgEvent</strong></span></p><p><span style="font-size: 15px">And insert the following code</span></p><p><span style="font-size: 15px">[CODE]if (Session.GetHabbo().In_Jail == 1)</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> Session.SendMessage(new RoomNotificationComposer("Notification",</span></p><p><span style="font-size: 15px"> " Oops , it appears you're jailed! \n\n" +</span></p><p><span style="font-size: 15px"> " You can't message your friends whilst jailed!", "small", ""));</span></p><p><span style="font-size: 15px"> return;</span></p><p><span style="font-size: 15px"> }[/CODE]</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>Go to FollowFriendEvent</strong></span></p><p><span style="font-size: 15px">And insert the following code</span></p><p><span style="font-size: 15px">[CODE] if (Session.GetHabbo().In_Jail == 1)</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> Session.SendMessage(new RoomNotificationComposer("Notification",</span></p><p><span style="font-size: 15px"> " Oops, it appears you're jailed ! \n\n" +</span></p><p><span style="font-size: 15px"> " You can't visit your friend whilst you're in jail!", "small", ""));</span></p><p><span style="font-size: 15px"> return;</span></p><p><span style="font-size: 15px"> }[/CODE]</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>Go to GameClient.cs and find the following</strong></span></p><p><span style="font-size: 15px">[CODE] if (!string.IsNullOrWhiteSpace(PlusEnvironment.GetDBConfig().DBData["welcome_message"]))</span></p><p><span style="font-size: 15px"> SendMessage(new MOTDNotificationComposer(PlusEnvironment.GetDBConfig().DBData["welcome_message"]));</span></p><p><span style="font-size: 15px">[/CODE]</span></p><p><span style="font-size: 15px"><strong>Under this put</strong></span></p><p><span style="font-size: 15px">[CODE] if (Session.GetHabbo().Jail_Time != 0)</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> Session.GetHabbo().StartJailTimer(Session, Session.GetHabbo().Jail_Time);</span></p><p><span style="font-size: 15px"> }</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"> if (Session.GetHabbo().Jail_Time == 0 && Session.GetHabbo().Jail_Time == 0)</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())</span></p><p><span style="font-size: 15px"> {</span></p><p><span style="font-size: 15px"> dbClient.SetQuery("UPDATE `users` SET `jail_time` = '0', `in_jail` = '0' WHERE id = @id");</span></p><p><span style="font-size: 15px"> dbClient.AddParameter("jail_time", 0);</span></p><p><span style="font-size: 15px"> dbClient.AddParameter("in_jail", 0);</span></p><p><span style="font-size: 15px"> dbClient.AddParameter("id", Session.GetHabbo().Id);</span></p><p><span style="font-size: 15px"> dbClient.RunQuery();</span></p><p><span style="font-size: 15px"> }</span></p><p><span style="font-size: 15px"> }</span></p><p><span style="font-size: 15px">[/CODE]</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>In GameClient find </strong></span></p><p><span style="font-size: 15px">[CODE]public bool TryAuthenticate(string AuthTicket)[/CODE]</span></p><p><span style="font-size: 15px">And replace with the following code</span></p><p><span style="font-size: 15px">[CODE] public bool TryAuthenticate(string AuthTicket,GameClient Session)[/CODE]</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>Now go to SSOTicketEvent</strong></span></p><p><span style="font-size: 15px">And replace the last line with the following code</span></p><p><span style="font-size: 15px">[CODE] Session.TryAuthenticate(Packet.PopString(), Session);[/CODE]</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>Nearly done just a few more classes!</strong></span></p><p><span style="font-size: 15px">Go to the following classes UpdateNavigatorSettingsEvent , GetNavigatorFlatsEvent , NewNavigatorSearchEvent , InitializeNewNavigatorEvent & CanCreateRoomEvent</span></p><p><span style="font-size: 15px">And insert the following code somewhere in each class</span></p><p><span style="font-size: 15px">[CODE] if (Session.GetHabbo().In_Jail == 1)</span></p><p><span style="font-size: 15px"> return;[/CODE]</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>Go to CommandManager</strong></span></p><p><span style="font-size: 15px">Add the following code</span></p><p><span style="font-size: 15px">[CODE]this.Register("jail", new JailUserCommand());[/CODE]</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>Add the following in permission_commands</strong></span></p><p><span style="font-size: 15px">[CODE]command_jail[/CODE]</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>Finally go to <a href="http://i.imgur.com/VcBwvaG.png" target="_blank">http://i.imgur.com/VcBwvaG.png</a> & download the image and save it as "small"</strong></span></p><p><span style="font-size: 15px">Then go to Swf/c_images/Notifications</span></p><p><span style="font-size: 15px">And drag it in there</span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px">Re-build your solution and you're done!</span></p><p>[/SPOILER]</p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong>Screenshots:</strong></span></p><p><span style="font-size: 15px"></span></p><p><span style="font-size: 15px"><strong><img src="http://image.prntscr.com/image/84d2948996f94abda1b776610a4a05c4.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /> </strong></span></p><p> </p><p></p><p><img src="http://image.prntscr.com/image/a65c2ea777064ff2b7e3a36f31d4a287.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p><img src="http://image.prntscr.com/image/bdc81c97a3cc42ebb1ae32e4aa0e3445.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p><img src="http://image.prntscr.com/image/38e57f300cdb4866aad72bdf279a7997.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p></p><p><img src="http://image.prntscr.com/image/51243bf89bcc4da2ba79ac2f12812016.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p>[doublepost=1494289742,1494289528][/doublepost]Looks easier than it is , if struggling to set up message me , failing that i'll just toss a download link for current revisions with this system on it</p></blockquote><p></p>
[QUOTE="SOUL, post: 409057, member: 64122"] [CENTER][SIZE=3] [IMG]https://habbo.md/images/logos/f35c477381a5cabdce6848d56a66385c/be7e2d29b7398d790345068bf3c5d316/cb768f.png[/IMG] [/SIZE][/CENTER] [SIZE=3] Yo, Releasing this as thought it would be a nice share anyhow...[/SIZE] [FONT=Arial][SIZE=4][B]How does this work?[/B][/SIZE][/FONT] [SIZE=3]Upon the user executing command in the format :jail username time the TargetClient will be sent to jail to the given time. A timer is then activated & disposed upon disconnection / completion of the timer. The user cannot talk , leave the room , use the navigator , follow their friends nor message their friends until their timer is completed [/SIZE] [SIZE=4][B]Why the fuck are you storing it in the DB?[/B][/SIZE] [SIZE=3]This was done a while ago keep in mind caching also uses a bit of RAM & CPU Usage , although thats no excuse to store it in the database rather than in memory. Not going to fix what ain't broken , in regards to your MySQL server this will put slight strain on it but not to any extent where it's going to damage or slow down your MySQL server so disregard any bullshit comments in regards to this.[/SIZE] [SIZE=4][B]Adding this to PlusEMU[/B] [/SIZE] [SPOILER] [B]Run both of these SQLS[/B] [CODE]ALTER TABLE `users` ADD `in_jail` int(11) NOT NULL ALTER TABLE `users` ADD `jail_time` int(11) NOT NULL[/CODE] [SIZE=4] [B]Go to Habbo.cs and find private int _id; under this put [/B][/SIZE] [CODE]public Timer JailTimer;[/CODE] [SIZE=4] [B]At the top of Habbo.cs put[/B] [/SIZE] [CODE]using System.Timers; [/CODE] [SIZE=4] [B]Find private int _friendCount; under this put[/B][/SIZE] [CODE]private int _jail_time; private int _in_jail;[/CODE] [SIZE=4] [B]Next find[/B][/SIZE] [CODE] public Habbo(int Id, string Username, int Rank, string Motto, string Look, string Gender, int Credits, int ActivityPoints, int HomeRoom, bool HasFriendRequestsDisabled, int LastOnline, bool AppearOffline, bool HideInRoom, double CreateDate, int Diamonds, string machineID, string clientVolume, bool ChatPreference, bool FocusPreference, bool PetsMuted, bool BotsMuted, bool AdvertisingReportBlocked, double LastNameChange, int GOTWPoints, bool IgnoreInvites, double TimeMuted, double TradingLock, bool AllowGifts, int FriendBarState, bool DisableForcedEffects, bool AllowMimic, int VIPRank)[/CODE] [SIZE=4] [B]At the end add [/B] [CODE],int In_Jail, int Jail_Time[/CODE] [B]Under the { add [/B][/SIZE] [CODE]this._jail_time = Jail_Time; this._in_jail = In_Jail;[/CODE] [SIZE=4] [B]Find [/B] [CODE]public int Id { get { return this._id; } set { this._id = value; } }[/CODE] [B]Under this add[/B] [CODE] public int Jail_Time { get { return this._jail_time; } set { this._jail_time = value; } } public int In_Jail { get { return this._in_jail; } set { this._in_jail = value; } }[/CODE] [B]Then find [/B] [CODE] public string GetQueryString { get { this._habboSaved = true; return "UPDATE `users` SET `online` = '0', `last_online` = '" + PlusEnvironment.GetUnixTimestamp() + "', `activity_points` = '" + this.Duckets + "', `credits` = '" + this.Credits + "', `in_jail` = '" + this.In_Jail + "', `jail_time` = '" + this.Jail_Time + "', `vip_points` = '" + this.Diamonds + "', `home_room` = '" + this.HomeRoom + "', `gotw_points` = '" + this.GOTWPoints + "', `time_muted` = '" + this.TimeMuted + "',`friend_bar_state` = '" + FriendBarStateUtility.GetInt(this._friendbarState) + "' WHERE id = '" + Id + "' LIMIT 1;UPDATE `user_stats` SET `roomvisits` = '" + this._habboStats.RoomVisits + "', `onlineTime` = '" + (PlusEnvironment.GetUnixTimestamp() - SessionStart + this._habboStats.OnlineTime) + "', `respect` = '" + this._habboStats.Respect + "', `respectGiven` = '" + this._habboStats.RespectGiven + "', `giftsGiven` = '" + this._habboStats.GiftsGiven + "', `giftsReceived` = '" + this._habboStats.GiftsReceived + "', `dailyRespectPoints` = '" + this._habboStats.DailyRespectPoints + "', `dailyPetRespectPoints` = '" + this._habboStats.DailyPetRespectPoints + "', `AchievementScore` = '" + this._habboStats.AchievementPoints + "', `quest_id` = '" + this._habboStats.QuestID + "', `quest_progress` = '" + this._habboStats.QuestProgress + "', `groupid` = '" + this._habboStats.FavouriteGroupId + "',`forum_posts` = '" + this._habboStats.ForumPosts + "' WHERE `id` = '" + this.Id + "' LIMIT 1;"; } }[/CODE] [B]And replace it with[/B] [CODE] public string GetQueryString { get { this._habboSaved = true; return "UPDATE `users` SET `online` = '0', `last_online` = '" + PlusEnvironment.GetUnixTimestamp() + "', `activity_points` = '" + this.Duckets + "', `credits` = '" + this.Credits + "', `in_jail` = '" + this.In_Jail + "', `jail_time` = '" + this.Jail_Time + "', `vip_points` = '" + this.Diamonds + "', `home_room` = '" + this.HomeRoom + "', `gotw_points` = '" + this.GOTWPoints + "', `time_muted` = '" + this.TimeMuted + "',`friend_bar_state` = '" + FriendBarStateUtility.GetInt(this._friendbarState) + "' WHERE id = '" + Id + "' LIMIT 1;UPDATE `user_stats` SET `roomvisits` = '" + this._habboStats.RoomVisits + "', `onlineTime` = '" + (PlusEnvironment.GetUnixTimestamp() - SessionStart + this._habboStats.OnlineTime) + "', `respect` = '" + this._habboStats.Respect + "', `respectGiven` = '" + this._habboStats.RespectGiven + "', `giftsGiven` = '" + this._habboStats.GiftsGiven + "', `giftsReceived` = '" + this._habboStats.GiftsReceived + "', `dailyRespectPoints` = '" + this._habboStats.DailyRespectPoints + "', `dailyPetRespectPoints` = '" + this._habboStats.DailyPetRespectPoints + "', `AchievementScore` = '" + this._habboStats.AchievementPoints + "', `quest_id` = '" + this._habboStats.QuestID + "', `quest_progress` = '" + this._habboStats.QuestProgress + "', `groupid` = '" + this._habboStats.FavouriteGroupId + "',`forum_posts` = '" + this._habboStats.ForumPosts + "' WHERE `id` = '" + this.Id + "' LIMIT 1;"; } }[/CODE] [B]Find[/B] [CODE] public void InitInformation(UserData data) { BadgeComponent = new BadgeComponent(this , data); Relationships = data.Relations; }[/CODE] [B]Under this insert[/B] [CODE]internal void StartJailTimer(GameClient Session, int Time) { Timer JailTimer = new Timer((Time * 60) * 1000); JailTimer.Start(); Session.GetHabbo().In_Jail = 1; JailTimer.Elapsed += (o, e) => { Session.GetHabbo().PrepareRoom(0, ""); Session.SendMessage(new RoomNotificationComposer("Notification", " You've been released from jail! \n\n" + " Next time behave yourself!!", "small", "")); using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { Session.GetHabbo().In_Jail = 0; dbClient.SetQuery("UPDATE `users` SET `jail_time` = @jail_time, `in_jail` = @in_jail, `home_room` = @home_room WHERE id = @id"); dbClient.AddParameter("jail_time", 0); dbClient.AddParameter("in_jail", 0); dbClient.AddParameter("home_room", 0); dbClient.AddParameter("id", Session.GetHabbo().Id); dbClient.RunQuery(); } JailTimer.Dispose(); } ;[/CODE] [B]Okay we're done with this class , now go to Authenticator.cs[/B] Change Convert.ToInt32(Row["rank_vip"])); to Convert.ToInt32(Row["rank_vip"]), and add the following code next to it [CODE] Convert.ToInt32(Row["in_jail"]), Convert.ToInt32(Row["jail_time"]));[/CODE] [B]Go to UserDataFactory.cs & Find[/B][/SIZE] [SIZE=4][CODE]dbClient.SetQuery("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 `auth_ticket` = @sso LIMIT 1"); dbClient.AddParameter("sso", SessionTicket);[/CODE] And replace with [CODE]dbClient.SetQuery("SELECT `id`,`username`,`rank`,`jail_time`,`in_jail`,`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 `auth_ticket` = @sso LIMIT 1"); dbClient.AddParameter("sso", SessionTicket);[/CODE] [B]Find[/B] [CODE] using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("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` = @id LIMIT 1"); dbClient.AddParameter("id", UserId);[/CODE] Replace with [CODE] using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("SELECT `id`,`username`,`rank`,`motto`,`jail_time`,`in_jail`,`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` = @id LIMIT 1"); dbClient.AddParameter("id", UserId);[/CODE] [B]Go to HabboHotel > Rooms > Chat > Commands > Administrator [/B] Right click then click "Add new class" and call it JailUserCommand Delete everything in the current class and replace it with [CODE]using Plus.Communication.Packets.Outgoing.Rooms.Notifications; using Plus.Database.Interfaces; using Plus.HabboHotel.GameClients; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Plus.HabboHotel.Rooms.Chat.Commands.Administrator { class JailUserCommand : IChatCommand { public string PermissionRequired => "command_jail"; public string Parameters => "%username% %time%"; public string Description => "Put a user in jail!."; public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { int Time = 0; int Time_Now; Time_Now = Time; if (Params.Length == 1) { Session.SendWhisper("Please enter the username of the user you wish to jail"); return; } GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]); if (TargetClient == null) { Session.SendWhisper($"An error occoured whilst trying to find {Params[1]}!"); return; } RoomUser TargetUser = Room.GetRoomUserManager().GetRoomUserByHabbo(TargetClient.GetHabbo().Id); if (TargetUser == null) { Session.SendWhisper($"An error occoured whilst trying to find {Params[1]}, maybe they're not online or in this room."); return; } if (TargetClient.GetHabbo().Rank > Session.GetHabbo().Rank) { Session.SendWhisper("Oops , it appears you can't jail this user!"); return; } if (Session.GetHabbo().In_Jail == 1) { Session.SendWhisper($"Oops , it appears {Params[1]} is already jailed!"); return; } if (Session == TargetClient) { Session.SendWhisper("You can't put yourself in jail!"); return; } if (Int32.TryParse(Params[2], out Time)) { Session.SendWhisper($"You have successfully jailed {Params[1]} for {Time} minutes!"); TargetClient.GetHabbo().PrepareRoom(// put room id of jail here // , ""); TargetClient.GetHabbo().StartJailTimer(TargetClient, Time); TargetClient.SendMessage(new RoomNotificationComposer("Notification", " You've been jailed by " + $"{Params[1]}\n\n" + " You've been jailed for " + $"{Time} " + "Minute(s)", "small", "")); using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("UPDATE `users` SET `jail_time` = @jail_time, `in_jail` = @in_jail, `home_room` = @home_room WHERE id = @id"); dbClient.AddParameter("jail_time", Params[2]); dbClient.AddParameter("in_jail", 1); dbClient.AddParameter("home_room", // your room id here //); dbClient.AddParameter("id", TargetClient.GetHabbo().Id); dbClient.RunQuery(); } } } } } [/CODE] [B]Navigate to the following classes , "ShoutEvent" "WhisperEvent" "ChatEvent"[/B] In each class insert the following code somewhere [CODE]if (Session.GetHabbo().In_Jail == 1) { Session.SendWhisper("You can't talk whilst you're in jail!"); return; }[/CODE] [B]Go to SendMsgEvent[/B] And insert the following code [CODE]if (Session.GetHabbo().In_Jail == 1) { Session.SendMessage(new RoomNotificationComposer("Notification", " Oops , it appears you're jailed! \n\n" + " You can't message your friends whilst jailed!", "small", "")); return; }[/CODE] [B]Go to FollowFriendEvent[/B] And insert the following code [CODE] if (Session.GetHabbo().In_Jail == 1) { Session.SendMessage(new RoomNotificationComposer("Notification", " Oops, it appears you're jailed ! \n\n" + " You can't visit your friend whilst you're in jail!", "small", "")); return; }[/CODE] [B]Go to GameClient.cs and find the following[/B] [CODE] if (!string.IsNullOrWhiteSpace(PlusEnvironment.GetDBConfig().DBData["welcome_message"])) SendMessage(new MOTDNotificationComposer(PlusEnvironment.GetDBConfig().DBData["welcome_message"])); [/CODE] [B]Under this put[/B] [CODE] if (Session.GetHabbo().Jail_Time != 0) { Session.GetHabbo().StartJailTimer(Session, Session.GetHabbo().Jail_Time); } if (Session.GetHabbo().Jail_Time == 0 && Session.GetHabbo().Jail_Time == 0) { using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("UPDATE `users` SET `jail_time` = '0', `in_jail` = '0' WHERE id = @id"); dbClient.AddParameter("jail_time", 0); dbClient.AddParameter("in_jail", 0); dbClient.AddParameter("id", Session.GetHabbo().Id); dbClient.RunQuery(); } } [/CODE] [B]In GameClient find [/B] [CODE]public bool TryAuthenticate(string AuthTicket)[/CODE] And replace with the following code [CODE] public bool TryAuthenticate(string AuthTicket,GameClient Session)[/CODE] [B]Now go to SSOTicketEvent[/B] And replace the last line with the following code [CODE] Session.TryAuthenticate(Packet.PopString(), Session);[/CODE] [B]Nearly done just a few more classes![/B] Go to the following classes UpdateNavigatorSettingsEvent , GetNavigatorFlatsEvent , NewNavigatorSearchEvent , InitializeNewNavigatorEvent & CanCreateRoomEvent And insert the following code somewhere in each class [CODE] if (Session.GetHabbo().In_Jail == 1) return;[/CODE] [B]Go to CommandManager[/B] Add the following code [CODE]this.Register("jail", new JailUserCommand());[/CODE] [B]Add the following in permission_commands[/B] [CODE]command_jail[/CODE] [B]Finally go to [URL]http://i.imgur.com/VcBwvaG.png[/URL] & download the image and save it as "small"[/B] Then go to Swf/c_images/Notifications And drag it in there Re-build your solution and you're done![/SIZE] [/SPOILER] [SIZE=4] [B]Screenshots:[/B] [B][IMG]http://image.prntscr.com/image/84d2948996f94abda1b776610a4a05c4.png[/IMG] [/B][/SIZE] [IMG]http://image.prntscr.com/image/a65c2ea777064ff2b7e3a36f31d4a287.png[/IMG] [IMG]http://image.prntscr.com/image/bdc81c97a3cc42ebb1ae32e4aa0e3445.png[/IMG] [IMG]http://image.prntscr.com/image/38e57f300cdb4866aad72bdf279a7997.png[/IMG] [IMG]http://image.prntscr.com/image/51243bf89bcc4da2ba79ac2f12812016.png[/IMG] [doublepost=1494289742,1494289528][/doublepost]Looks easier than it is , if struggling to set up message me , failing that i'll just toss a download link for current revisions with this system on it [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
Server Releases
[PlusEMU] Jail System
Top