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
Delete User
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="Altercationz" data-source="post: 448570" data-attributes="member: 59038"><p>I seen a release from [USER=83881]@Hypothesis[/USER] which was a delete user command which didn't execute everything properly, or delete everything. This should do the trick.</p><p>Credits to him for the idea.</p><p>I don't know why'd you would need this as retros cant afford to lose any user nowadays.</p><p></p><p><strong>But, </strong>if you want to delete some annoying kid here you go <img src="/styles/icons/smile/bttv/LUL.png" class="smilie" loading="lazy" alt="LUL" title="LUL LUL" data-shortname="LUL" /></p><p></p><p>- This command will check if the user has logged on within the last 3 days, if that happens to be true the user will not be deleted.</p><p>- I put a couple sql queries to delete pretty much everything to not keep useless data in your tables.</p><p>- I put a query which will give all of the user's rooms to you, never know if he has a sick room or something lmfao.</p><p>- Obviously if the user is online it won't delete their account.</p><p>- Can't delete anybody higher than rank 4.</p><p></p><p>so yeah, have fun.</p><p></p><p>[CODE]</p><p>using System;</p><p>using System.Linq;</p><p>using System.Text;</p><p>using System.Collections.Generic;</p><p></p><p>using Plus.Communication.Packets.Incoming;</p><p>using Plus.Communication.Packets.Outgoing.Rooms.Engine;</p><p>using Plus.Communication.Packets.Outgoing.Users;</p><p>using Plus.Database.Interfaces;</p><p>using Plus.HabboHotel.GameClients;</p><p>using Plus.Communication.Packets.Outgoing.Rooms.Chat;</p><p>using Plus.Utilities;</p><p>using Plus.HabboHotel.Users;</p><p></p><p>namespace Plus.HabboHotel.Rooms.Chat.Commands.Administrator</p><p>{</p><p> class</p><p> DeleteUserCommand : IChatCommand</p><p> {</p><p> public string PermissionRequired</p><p> {</p><p> get { return "command_delete"; }</p><p> }</p><p></p><p> public string Parameters</p><p> {</p><p> get { return "%username%"; }</p><p> }</p><p></p><p> public string Description</p><p> {</p><p> get { return "Delete a user."; }</p><p> }</p><p></p><p> public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)</p><p> {</p><p> if (Params.Length == 1)</p><p> {</p><p> Session.SendWhisper("Oops, you forgot to enter the username! Command Usage: :delete (user)");</p><p> return;</p><p> }</p><p></p><p> Habbo User = PlusEnvironment.GetHabboByUsername(Params[1]);</p><p></p><p> DateTime Now = DateTime.Now;</p><p> double LastLogin = Convert.ToSingle(Now.AddDays(-3));</p><p> double OnlineNow = Convert.ToSingle(Now);</p><p></p><p> if (User.LastOnline == LastLogin)</p><p> {</p><p> Session.SendWhisper("The user " + Params[1] + " has logged on within the last 3 days, therefore it cannot be deleted.");</p><p> }</p><p></p><p> if (User.LastOnline == OnlineNow)</p><p> {</p><p> return;</p><p> }</p><p></p><p> if (Session.GetHabbo().Username == User.Username)</p><p> {</p><p> return;</p><p> }</p><p></p><p> if (User.Rank > 4)</p><p> {</p><p> return;</p><p> }</p><p></p><p> using (IQueryAdapter Adapter = PlusEnvironment.GetDatabaseManager().GetQueryReactor())</p><p> {</p><p> Adapter.RunQuery("DELETE FROM `users` WHERE username = '" + User + "' LIMIT 1");</p><p> Adapter.RunQuery("DELETE FROM `user_stats` WHERE id = '" + User.Id + "' LIMIT 1");</p><p> Adapter.RunQuery("DELETE FROM `user_info` WHERE user_id = '" + User.Id + "' LIMIT 1");</p><p> Adapter.RunQuery("DELETE FROM `user_relationships` WHERE user_id = '" + User.Id + "' LIMIT 1");</p><p> Adapter.RunQuery("DELETE FROM `user_login_attemps WHERE userid = '" + User.Id + "' LIMIT 1");</p><p> Adapter.RunQuery("UPDATE `rooms` SET owner = '" + Session.GetHabbo().Id + "' WHERE owner = '" + User.Id + "' LIMIT 1");</p><p> Adapter.RunQuery("DELETE FROM `user_achievements` WHERE userid = '" + User.Id + "' LIMIT 1");</p><p> }</p><p> }</p><p> }</p><p>}[/CODE]</p></blockquote><p></p>
[QUOTE="Altercationz, post: 448570, member: 59038"] I seen a release from [USER=83881]@Hypothesis[/USER] which was a delete user command which didn't execute everything properly, or delete everything. This should do the trick. Credits to him for the idea. I don't know why'd you would need this as retros cant afford to lose any user nowadays. [B]But, [/B]if you want to delete some annoying kid here you go LUL - This command will check if the user has logged on within the last 3 days, if that happens to be true the user will not be deleted. - I put a couple sql queries to delete pretty much everything to not keep useless data in your tables. - I put a query which will give all of the user's rooms to you, never know if he has a sick room or something lmfao. - Obviously if the user is online it won't delete their account. - Can't delete anybody higher than rank 4. so yeah, have fun. [CODE] using System; using System.Linq; using System.Text; using System.Collections.Generic; using Plus.Communication.Packets.Incoming; using Plus.Communication.Packets.Outgoing.Rooms.Engine; using Plus.Communication.Packets.Outgoing.Users; using Plus.Database.Interfaces; using Plus.HabboHotel.GameClients; using Plus.Communication.Packets.Outgoing.Rooms.Chat; using Plus.Utilities; using Plus.HabboHotel.Users; namespace Plus.HabboHotel.Rooms.Chat.Commands.Administrator { class DeleteUserCommand : IChatCommand { public string PermissionRequired { get { return "command_delete"; } } public string Parameters { get { return "%username%"; } } public string Description { get { return "Delete a user."; } } public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params) { if (Params.Length == 1) { Session.SendWhisper("Oops, you forgot to enter the username! Command Usage: :delete (user)"); return; } Habbo User = PlusEnvironment.GetHabboByUsername(Params[1]); DateTime Now = DateTime.Now; double LastLogin = Convert.ToSingle(Now.AddDays(-3)); double OnlineNow = Convert.ToSingle(Now); if (User.LastOnline == LastLogin) { Session.SendWhisper("The user " + Params[1] + " has logged on within the last 3 days, therefore it cannot be deleted."); } if (User.LastOnline == OnlineNow) { return; } if (Session.GetHabbo().Username == User.Username) { return; } if (User.Rank > 4) { return; } using (IQueryAdapter Adapter = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { Adapter.RunQuery("DELETE FROM `users` WHERE username = '" + User + "' LIMIT 1"); Adapter.RunQuery("DELETE FROM `user_stats` WHERE id = '" + User.Id + "' LIMIT 1"); Adapter.RunQuery("DELETE FROM `user_info` WHERE user_id = '" + User.Id + "' LIMIT 1"); Adapter.RunQuery("DELETE FROM `user_relationships` WHERE user_id = '" + User.Id + "' LIMIT 1"); Adapter.RunQuery("DELETE FROM `user_login_attemps WHERE userid = '" + User.Id + "' LIMIT 1"); Adapter.RunQuery("UPDATE `rooms` SET owner = '" + Session.GetHabbo().Id + "' WHERE owner = '" + User.Id + "' LIMIT 1"); Adapter.RunQuery("DELETE FROM `user_achievements` WHERE userid = '" + User.Id + "' LIMIT 1"); } } } }[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
Server Releases
Delete User
Top