Advertisement
Guest User

ghghgh

a guest
Apr 27th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. using Plus.HabboHotel.GameClients;
  2. using Plus.HabboHotel.Rooms;
  3. using Plus.HabboHotel.Rooms.Chat.Commands;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9.  
  10. namespace Plus.HabboHotel.Roleplay.Commands.Developer
  11. {
  12. internal sealed class EscortCommand : IChatCommand
  13. {
  14. public string PermissionRequired => "";
  15. public string Parameters => "%username%";
  16. public string Description => "Escort a user, make the move in synchronization with your avatar.";
  17.  
  18. public void Execute(GameClient session, Room room, string[] Params)
  19. {
  20. if (Params.Length == 1)
  21. return;
  22.  
  23. GameClient target = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
  24.  
  25. if (target == null)
  26. {
  27. session.SendWhisper($"Couldn't find user {Params[1]} in this room!");
  28. return;
  29. }
  30.  
  31. RoomUser targetUser = room.GetRoomUserManager().GetRoomUserByHabbo(target.GetHabbo().Id);
  32.  
  33. if (targetUser == null)
  34. {
  35. session.SendWhisper($"Couldn't find user {Params[1]} in this room!");
  36. return;
  37. }
  38.  
  39. RoomUser user = room.GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
  40.  
  41. user.Escorting = targetUser;
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement