nahbr0

Untitled

Aug 24th, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.09 KB | None | 0 0
  1. using iced.Communication.Packets.Outgoing.Rooms.Chat;
  2. using iced.Communication.Packets.Outgoing.Rooms.Engine;
  3. using iced.Communication.Packets.Outgoing.Rooms.Notifications;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9.  
  10. namespace iced.HabboHotel.Rooms.Chat.Commands.User.Fun
  11. {
  12. class EmojiCommand : IChatCommand
  13. {
  14. public string PermissionRequired
  15. {
  16. get { return "user_vip"; }
  17. }
  18. public string Parameters
  19. {
  20. get { return "%numbers 1-189%"; }
  21. }
  22. public string Description
  23. {
  24. get { return "Send en emoji."; }
  25. }
  26. public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
  27. {
  28. if (Params.Length == 1)
  29. {
  30. Session.SendWhisper("Oops, du skal indtaste et tal mellem 1-189! For at se emoji listen, skriv :emoji list.", 34);
  31. return;
  32. }
  33. string emoji = Params[1];
  34.  
  35. if (emoji.Equals("list"))
  36. {
  37. Session.SendMessage(new MassEventComposer("habbopages/chat/emoji.txt"));
  38. }
  39. else
  40. {
  41. int emojiNum;
  42. bool isNumeric = int.TryParse(emoji, out emojiNum);
  43. if (isNumeric)
  44. {
  45. string chatcolor = Session.GetHabbo().chatHTMLColour;
  46. int chatsize = Session.GetHabbo().chatHTMLSize;
  47.  
  48. Session.GetHabbo().chatHTMLColour = "";
  49. Session.GetHabbo().chatHTMLSize = 12;
  50. switch (emojiNum)
  51. {
  52. default:
  53. bool isValid = true;
  54. if (emojiNum < 1)
  55. {
  56. isValid = false;
  57. }
  58.  
  59. if (emojiNum > 189 && Session.GetHabbo().Rank < 6)
  60. {
  61. isValid = false;
  62. }
  63. if (isValid)
  64. {
  65. string Username;
  66. RoomUser TargetUser = Session.GetHabbo().CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Username);
  67. if (emojiNum < 10)
  68. {
  69. Username = "<img src='/game/c_images/emoji/" + emojiNum + ".png' height='20' width='20'><br> ";
  70. }
  71. else
  72. {
  73. Username = "<img src='/game/c_images/emoji/" + emojiNum + ".png' height='20' width='20'><br> ";
  74. }
  75. if (Room != null)
  76. Room.SendMessage(new UserNameChangeComposer(Session.GetHabbo().CurrentRoomId, TargetUser.VirtualId, Username));
  77.  
  78. string Message = " ";
  79. Room.SendMessage(new ChatComposer(TargetUser.VirtualId, Message, 0, TargetUser.LastBubble));
  80. TargetUser.SendNamePacket();
  81.  
  82. }
  83. else
  84. {
  85. Session.SendWhisper("Emoji ugyldig, det skal være et tal mellem 1-189. For at se listen over emojis, skriv :emoji list.", 34);
  86. }
  87.  
  88. break;
  89. }
  90. Session.GetHabbo().chatHTMLColour = chatcolor;
  91. Session.GetHabbo().chatHTMLSize = chatsize;
  92. }
  93. else
  94. {
  95. Session.SendWhisper("Emoji ugyldig, det skal være et tal mellem 1-189. For at se listen over emojis, skriv :emoji list.", 34);
  96. }
  97. }
  98. return;
  99. }
  100. }
  101. }
Advertisement
Add Comment
Please, Sign In to add comment