Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. using Plus.Database.Interfaces;
  8. using Plus.Utilities;
  9. using Plus.HabboHotel.Users;
  10. using Plus.HabboHotel.GameClients;
  11.  
  12. using Plus.Core;
  13. using Plus.Communication.Packets.Incoming;
  14. using Plus.HabboHotel.Rooms;
  15. using Plus.HabboHotel.Quests;
  16. using Plus.Communication.Packets.Outgoing.Rooms.Engine;
  17.  
  18. namespace Plus.HabboHotel.Rooms.Chat.Commands.Moderator
  19. {
  20. class DelMottoCommand : IChatCommand
  21. {
  22. public string PermissionRequired
  23. {
  24. get { return "command_delmotto"; }
  25. }
  26.  
  27. public string Parameters
  28. {
  29. get { return "%username%"; }
  30. }
  31.  
  32. public string Description
  33. {
  34. get { return "Change a motto that is against the rules."; }
  35. }
  36.  
  37. public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
  38. {
  39. Habbo Habbo = PlusEnvironment.GetHabboByUsername(Params[1]);
  40. if (Habbo == null)
  41. {
  42. Session.SendWhisper("Couldn't find user in database.");
  43. return;
  44. }
  45.  
  46. if (Habbo.GetPermissions().HasRight("mod_tool"))
  47. {
  48. Session.SendWhisper("Oops, you cannot change that user's motto.");
  49. return;
  50. }
  51.  
  52. using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
  53. {
  54. dbClient.SetQuery("UPDATE `users` SET `motto` = 'Motto is against the Habbo Rules' WHERE `id` = '" + Habbo.Id + "' LIMIT 1");
  55. dbClient.RunQuery();
  56. }
  57.  
  58. if (Habbo.GetClient() != null)
  59. {
  60. Habbo.GetClient().SendNotification("Your motto has been deleted by a moderator.");
  61. }
  62.  
  63. Session.SendWhisper("You succesfully deleted " + Habbo.Username + "'s motto ");
  64.  
  65. RoomUser User = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]); // Hier zit de fout.
  66. Room.SendMessage(new UserChangeComposer(User, false));
  67.  
  68. }
  69. }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement