Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. Inside Messages > Requests > Users.cs add under the ChangeLook() void this:
  2.  
  3. private void ChangeMotto()
  4. {
  5. string RequestMotto = Request.PopFixedString();
  6.  
  7. string Motto = UberEnvironment.FilterInjectionChars(RequestMotto.Substring(35));
  8.  
  9. if (Motto == Session.GetHabbo().Motto) // Prevents spam?
  10. {
  11. return;
  12. }
  13.  
  14. Session.GetHabbo().Motto = Motto;
  15.  
  16. using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
  17. {
  18. dbClient.AddParamWithValue("motto", Motto);
  19. dbClient.ExecuteQuery("UPDATE users SET motto = @motto WHERE id = '" + Session.GetHabbo().Id + "' LIMIT 1");
  20. }
  21.  
  22. if (Session.GetHabbo().InRoom)
  23. {
  24. Room Room = Session.GetHabbo().CurrentRoom;
  25.  
  26. if (Room == null)
  27. {
  28. return;
  29. }
  30.  
  31. RoomUser User = Room.GetRoomUserByHabbo(Session.GetHabbo().Id);
  32.  
  33. if (User == null)
  34. {
  35. return;
  36. }
  37.  
  38. ServerMessage RoomUpdate = new ServerMessage(266);
  39. RoomUpdate.AppendInt32(User.VirtualId);
  40. RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Look);
  41. RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Gender.ToLower());
  42. RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Motto);
  43. RoomUpdate.AppendInt32(Session.GetHabbo().GetAchievementScore());
  44. Room.SendMessage(RoomUpdate);
  45. }
  46.  
  47. UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 5, 1);
  48. }
  49.  
  50. Inside Messages > Requests > Users.cs add under "RequestHandlers[44] = new RequestHandler(ChangeLook);" this:
  51.  
  52. RequestHandlers[484] = new RequestHandler(ChangeMotto);
  53.  
  54. THANKS FOR ADDING, FINALLYYY!!! :D, I'm not sure if that substring thingie works fine, but should do the job..
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement