Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
469
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Text;
  4. using System.Collections.Generic;
  5.  
  6. using Plus.Utilities;
  7. using Plus.HabboHotel.Users;
  8. using Plus.HabboHotel.GameClients;
  9.  
  10. using Plus.HabboHotel.Moderation;
  11. using Plus.Database.Interfaces;
  12.  
  13. namespace Plus.HabboHotel.Rooms.Chat.Commands.Moderator
  14. {
  15. class RankCommand : IChatCommand
  16. {
  17. public string PermissionRequired
  18. {
  19. get { return "command_rank"; }
  20. }
  21.  
  22. public string Parameters
  23. {
  24. get { return "%pseudo% %numrank%"; }
  25. }
  26.  
  27. public string Description
  28. {
  29. get { return "Rank une personne."; }
  30. }
  31.  
  32. public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
  33. {
  34. if (Params.Length != 3)
  35. {
  36. Session.SendWhisper("Veuillez entre un pseudo + le numero du rank");
  37. return;
  38. }
  39.  
  40. GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
  41. if (TargetClient != null)
  42. {
  43.  
  44. using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
  45. {
  46. dbClient.RunQuery("UPDATE `users` SET `rank` = '" + Params[2] + "' WHERE `id` = '" + TargetClient.GetHabbo().Id + "' LIMIT 1");
  47. }
  48. Session.SendWhisper("L'utilisateur " + TargetClient.GetHabbo().Username + " à été rank " + Params[2] + " !");
  49. }
  50. else
  51. {
  52.  
  53. Session.SendWhisper("Oups, utilisateur introuvable.");
  54. return;
  55. }
  56. }
  57. }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement