Guest User

Untitled

a guest
Apr 11th, 2017
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.96 KB | None | 0 0
  1.                 if (PlusEnvironment.Antipub(Message))
  2.                 {
  3.                     using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
  4.                     {
  5.  
  6.                         DataTable Table = null;
  7.                         dbClient.SetQuery("SELECT * FROM users WHERE id = '" + Session.GetHabbo().Id + "' LIMIT 1");
  8.                         Table = dbClient.getTable();
  9.                         foreach (DataRow dRow in Table.Rows)
  10.                         {
  11.                             if (Convert.ToInt32(dRow["antipub_points"]) == 4)
  12.                             {
  13.                                 dbClient.RunQuery("UPDATE `users` SET `antipub_points` = 3 WHERE `id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
  14.                             }
  15.                             if (Convert.ToInt32(dRow["antipub_points"]) == 3)
  16.                             {
  17.                                 dbClient.RunQuery("UPDATE `users` SET `antipub_points` = 2 WHERE `id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
  18.                             }
  19.                             if (Convert.ToInt32(dRow["antipub_points"]) == 2)
  20.                             {
  21.                                 dbClient.RunQuery("UPDATE `users` SET `antipub_points` = 1 WHERE `id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
  22.                             }
  23.                             if (Convert.ToInt32(dRow["antipub_points"]) == 1)
  24.                             {
  25.                                 dbClient.RunQuery("UPDATE `users` SET `antipub_points` = 0 WHERE `id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
  26.                             }
  27.  
  28.                             int nopub = Convert.ToInt32(dRow["antipub_points"]);
  29.                             if (Convert.ToInt32(dRow["antipub_points"]) < 1)
  30.                             {
  31.                                 Double Expire = PlusEnvironment.GetUnixTimestamp() + 78892200;
  32.                                 Session.SendWhisper("Ton compte est banni !", 34);
  33.                                 PlusEnvironment.GetGame().GetModerationManager().BanUser("#ANTIPUB", HabboHotel.Moderation.ModerationBanType.IP, Convert.ToString(dRow["ip_last"]), "Publicité.", Expire);
  34.                                 Session.Disconnect();
  35.                             }
  36.                             if (nopub > 1)
  37.                             {
  38.                                 Session.SendMessage(new RoomNotificationComposer("Robot Antipub",
  39.                                      "<b>Attention " + Session.GetHabbo().Username + " !</b>\n" +
  40.                                      "Notre robot viens de detecté une publicité dans votre message. </b>.\n<b><font color='red'>Il vous reste " + nopub + " chances avant de vous sanctionnez!</font></b>\r" +
  41.                                      "\n\n", "pub", "J'ai compris.", "event:close"));
  42.                                 Console.ForegroundColor = ConsoleColor.Red;
  43.                                 Console.WriteLine("[ANTIPUB] Mot filtré de (" + Session.GetHabbo().Username + ")");
  44.                             }
  45.                             else
  46.                             {
  47.                                 Session.SendMessage(new RoomNotificationComposer("Robot Antipub",
  48.                                      "<b>Attention " + Session.GetHabbo().Username + " !</b>\n" +
  49.                                      "Notre robot viens de detecté une publicité dans votre message. </b>.\n<b><font color='red'>Il vous reste " + nopub + " chances avant de vous sanctionnez!</font></b>\r" +
  50.                                      "\n\n", "pub", "J'ai compris.", "event:close"));
  51.                                 Console.ForegroundColor = ConsoleColor.Red;
  52.                                 Console.WriteLine("[ANTIPUB] Mot filtré de (" + Session.GetHabbo().Username + ")");
  53.                             }
  54.                             Message = "# Filtré par l'antipub #";
  55.                         }
  56.                     }
  57.                 }
Advertisement
Add Comment
Please, Sign In to add comment