Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. private void ChangeMotto()
  2. {
  3. string RequestMotto = Request.PopFixedString();
  4.  
  5. string Motto = UberEnvironment.FilterInjectionChars(RequestMotto.Substring(35));
  6.  
  7. if (Motto == Session.GetHabbo().Motto) // Prevents spam?
  8. {
  9. return;
  10. }
  11.  
  12. Session.GetHabbo().Motto = Motto;
  13.  
  14. using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
  15. {
  16. dbClient.AddParamWithValue("motto", Motto);
  17. dbClient.ExecuteQuery("UPDATE users SET motto = @motto WHERE id = '" + Session.GetHabbo().Id + "' LIMIT 1");
  18. }
  19.  
  20. if (Session.GetHabbo().InRoom)
  21. {
  22. Room Room = Session.GetHabbo().CurrentRoom;
  23.  
  24. if (Room == null)
  25. {
  26. return;
  27. }
  28.  
  29. RoomUser User = Room.GetRoomUserByHabbo(Session.GetHabbo().Id);
  30.  
  31. if (User == null)
  32. {
  33. return;
  34. }
  35.  
  36. ServerMessage RoomUpdate = new ServerMessage(266);
  37. RoomUpdate.AppendInt32(User.VirtualId);
  38. RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Look);
  39. RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Gender.ToLower());
  40. RoomUpdate.AppendStringWithBreak(Session.GetHabbo().Motto);
  41. RoomUpdate.AppendInt32(Session.GetHabbo().GetAchievementScore());
  42. Room.SendMessage(RoomUpdate);
  43. }
  44.  
  45. UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(Session, 5, 1);
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement