Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void GiveRespect()
- {
- Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
- if (Room == null || Session.GetHabbo().DailyRespectPoints <= 0)
- {
- return;
- }
- RoomUser User = Room.GetRoomUserByHabbo(Request.PopWiredUInt());
- if (User == null || User.GetClient().GetHabbo().Id == Session.GetHabbo().Id || User.IsBot)
- {
- return;
- }
- Session.GetHabbo().DailyRespectPoints--;
- User.GetClient().GetHabbo().Respect++;
- DataRow Respeitos_Dado = null;
- using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
- {
- dbClient.ExecuteQuery("UPDATE users SET respect = respect + 1 WHERE id = '" + User.GetClient().GetHabbo().Id + "' LIMIT 1");
- dbClient.ExecuteQuery("UPDATE users SET daily_respect_points = daily_respect_points - 1, respects_given = respects_given + 1 WHERE id = '" + Session.GetHabbo().Id + "' LIMIT 1");
- Respeitos_Dado = dbClient.ReadDataRow("SELECT SQL_NO_CACHE respects_given FROM users WHERE id = '" + Session.GetHabbo().Id + "' LIMIT 1");
- }
- /*
- * PLEASE DO NOT REMOVE THE CREDITS.
- * CREDITS TO lucaspaulino OF RAGEZONE! I'm Brazilian, sorry! :P
- */
- int RespeitosDado = (int)Respeitos_Dado["respects_given"];
- if (RespeitosDado == 100)
- {
- UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 16, 1);
- }
- int Respeitos = User.GetClient().GetHabbo().Respect;
- if (Respeitos == 1)
- {
- UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 15, 1);
- }
- if (Respeitos == 6)
- {
- UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 15, 2);
- }
- if (Respeitos == 16)
- {
- UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 15, 3);
- }
- if (Respeitos == 66)
- {
- UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 15, 4);
- }
- if (Respeitos == 166)
- {
- UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 15, 5);
- }
- if (Respeitos == 366)
- {
- UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 15, 6);
- }
- if (Respeitos == 566)
- {
- UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 15, 7);
- }
- if (Respeitos == 766)
- {
- UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 15, 8);
- }
- if (Respeitos == 966)
- {
- UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 15, 9);
- }
- if (Respeitos == 1116)
- {
- UberEnvironment.GetGame().GetAchievementManager().UnlockAchievement(User.GetClient(), 15, 10);
- }
- // FxkqUzYP_
- ServerMessage Message = new ServerMessage(440);
- Message.AppendUInt(User.GetClient().GetHabbo().Id);
- Message.AppendInt32(User.GetClient().GetHabbo().Respect);
- Room.SendMessage(Message);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement