Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. using Quasar.HabboHotel.GameClients;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace Quasar.HabboHotel.Rooms.Chat.Commands.Gebruiker
  9. {
  10. class WelcomeCommand : IChatCommand
  11. {
  12. public string PermissionRequired
  13. {
  14. get { return "command_welcome"; }
  15. }
  16. public string Parameters
  17. {
  18. get { return "%username%"; }
  19. }
  20. public string Description
  21. {
  22. get { return "Welcome another user to the hotel!"; }
  23. }
  24. public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
  25. {
  26. if (Params.Length == 1)
  27. {
  28. Session.SendWhisper("You must enter a username!");
  29. return;
  30. }
  31.  
  32. GameClient TargetClient = QuasarEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
  33. if (TargetClient == null)
  34. {
  35. Session.SendWhisper("That user cannot be found, maybe they're offline or not in the room.");
  36. return;
  37. }
  38.  
  39. RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(TargetClient.GetHabbo().Id);
  40. if (User == null)
  41. {
  42. Session.SendWhisper("The user cannot be found, maybe they're offline or not in the room.");
  43. return;
  44. }
  45. RoomUser Self = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
  46. if (User == Self)
  47. {
  48. Session.SendWhisper("You can't welcome yourself!");
  49. return;
  50. }
  51. RoomUser ThisUser = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
  52. if (ThisUser == null)
  53. return;
  54.  
  55. if (Session.GetHabbo().CurrentRoomId == TargetClient.GetHabbo().CurrentRoomId)
  56. {
  57. Session.SendMessage("Welcome to Habwave " + TargetClient.GetHabbo().Username + "! We hope you enjoy your stay!");
  58. }
  59. }
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement