Advertisement
Guest User

UnMute Command

a guest
May 12th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Text;
  4. using System.Collections.Generic;
  5. using Plus.Database.Interfaces;
  6. using Plus.Utilities;
  7. using Plus.HabboHotel.GameClients;
  8.  
  9.  
  10. namespace Plus.HabboHotel.Rooms.Chat.Commands.Moderator
  11. {
  12. class UnmuteCommand : IChatCommand
  13. {
  14. public string PermissionRequired
  15. {
  16. get { return "command_unmute"; }
  17. }
  18.  
  19. public string Parameters
  20. {
  21. get { return "%username%"; }
  22. }
  23.  
  24. public string Description
  25. {
  26. get { return "Réactiver un utilisateur actuellement mis en sourdine."; }
  27. }
  28.  
  29. public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
  30. {
  31. if (Params.Length == 1)
  32. {
  33. Session.SendWhisper("S'il vous plaît entrez le nom de l'utilisateur que vous souhaitez désactiver.");
  34. return;
  35. }
  36.  
  37. GameClient TargetClient = HobbawEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
  38. if (TargetClient == null || TargetClient.GetHabbo() == null)
  39. {
  40. Session.SendWhisper("Une erreur est survenue tout en trouvant l'utilisateur, peut-être qu'ils ne sont pas en ligne.");
  41. return;
  42. }
  43.  
  44. using (IQueryAdapter dbClient = HobbawEnvironment.GetDatabaseManager().GetQueryReactor())
  45. {
  46. dbClient.RunQuery("UPDATE `users` SET `time_muted` = '0' WHERE `id` = '" + TargetClient.GetHabbo().Id + "' LIMIT 1");
  47. }
  48.  
  49. TargetClient.GetHabbo().TimeMuted = 0;
  50. TargetClient.SendNotification("Vous avez été démuté par " + Session.GetHabbo().Username + "!");
  51. Session.SendWhisper("Le joueur " + TargetClient.GetHabbo().Username + " a été démuté avec succès!");
  52. }
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement