Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.75 KB | None | 0 0
  1. private void GiveRespect()
  2.         {
  3.             Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
  4.  
  5.             if (Room == null || Session.GetHabbo().DailyRespectPoints <= 0)
  6.             {
  7.                 return;
  8.             }
  9.  
  10.             RoomUser User = Room.GetRoomUserByHabbo(Request.PopWiredUInt());
  11.            
  12.             if (User == null || User.GetClient().GetHabbo().Id == Session.GetHabbo().Id || User.IsBot)
  13.             {
  14.                 return;
  15.             }
  16.  
  17.             Session.GetHabbo().DailyRespectPoints--;
  18.             User.GetClient().GetHabbo().Respect++;
  19.             DataRow Respeitos_Dado = null;
  20.  
  21.             using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
  22.             {
  23.                 dbClient.ExecuteQuery("UPDATE users SET respect = respect + 1 WHERE id = '" + User.GetClient().GetHabbo().Id + "' LIMIT 1");
  24.                 dbClient.ExecuteQuery("UPDATE users SET daily_respect_points = daily_respect_points - 1, respects_given = respects_given + 1 WHERE id = '" + Session.GetHabbo().Id + "' LIMIT 1");
  25.                 Respeitos_Dado = dbClient.ReadDataRow("SELECT SQL_NO_CACHE respects_given FROM users WHERE id = '" + Session.GetHabbo().Id + "' LIMIT 1");
  26.             }
  27.  
  28.             /*
  29.              * PLEASE DO NOT REMOVE THE CREDITS.
  30.              * CREDITS TO lucaspaulino OF RAGEZONE! I'm Brazilian, sorry! :P
  31.             */
  32.  
  33.             int RespeitosDado = (int)Respeitos_Dado["respects_given"];
  34.             if (RespeitosDado == 100)
  35.             {
  36.                 UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 16, 1);
  37.             }
  38.  
  39.             int Respeitos = User.GetClient().GetHabbo().Respect;
  40.  
  41.             if (Respeitos == 1)
  42.             {
  43.                 UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 15, 1);
  44.             }
  45.             if (Respeitos == 6)
  46.             {
  47.                 UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 15, 2);
  48.             }
  49.             if (Respeitos == 16)
  50.             {
  51.                 UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 15, 3);
  52.             }
  53.             if (Respeitos == 66)
  54.             {
  55.                 UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 15, 4);
  56.             }
  57.             if (Respeitos == 166)
  58.             {
  59.                 UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 15, 5);
  60.             }
  61.             if (Respeitos == 366)
  62.             {
  63.                 UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 15, 6);
  64.             }
  65.             if (Respeitos == 566)
  66.             {
  67.                 UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 15, 7);
  68.             }
  69.             if (Respeitos == 766)
  70.             {
  71.                 UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 15, 8);
  72.             }
  73.             if (Respeitos == 966)
  74.             {
  75.                 UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 15, 9);
  76.             }
  77.             if (Respeitos == 1116)
  78.             {
  79.                 UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 15, 10);
  80.             }
  81.  
  82.             // FxkqUzYP_
  83.             ServerMessage Message = new ServerMessage(440);
  84.             Message.AppendUInt(User.GetClient().GetHabbo().Id);
  85.             Message.AppendInt32(User.GetClient().GetHabbo().Respect);
  86.             Room.SendMessage(Message);
  87.            
  88.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement