Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (PlusEnvironment.Antipub(Message))
- {
- using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
- {
- DataTable Table = null;
- dbClient.SetQuery("SELECT * FROM users WHERE id = '" + GetClient().GetHabbo().Id + "' LIMIT 1");
- Table = dbClient.getTable();
- foreach (DataRow dRow in Table.Rows)
- {
- if (Convert.ToInt32(dRow["antipub_points"]) == 4)
- {
- dbClient.RunQuery("UPDATE `users` SET `antipub_points` = 3 WHERE `id` = '" + GetClient().GetHabbo().Id + "' LIMIT 1");
- }
- if (Convert.ToInt32(dRow["antipub_points"]) == 3)
- {
- dbClient.RunQuery("UPDATE `users` SET `antipub_points` = 2 WHERE `id` = '" + GetClient().GetHabbo().Id + "' LIMIT 1");
- }
- if (Convert.ToInt32(dRow["antipub_points"]) == 2)
- {
- dbClient.RunQuery("UPDATE `users` SET `antipub_points` = 1 WHERE `id` = '" + GetClient().GetHabbo().Id + "' LIMIT 1");
- }
- if (Convert.ToInt32(dRow["antipub_points"]) == 1)
- {
- dbClient.RunQuery("UPDATE `users` SET `antipub_points` = 0 WHERE `id` = '" + GetClient().GetHabbo().Id + "' LIMIT 1");
- }
- int nopub = Convert.ToInt32(dRow["antipub_points"]);
- if (Convert.ToInt32(dRow["antipub_points"]) < 1)
- {
- Double Expire = PlusEnvironment.GetUnixTimestamp() + 78892200;
- GetClient().SendWhisper("Ton compte est banni !", 34);
- PlusEnvironment.GetGame().GetModerationManager().BanUser("#ANTIPUB", HabboHotel.Moderation.ModerationBanType.IP, Convert.ToString(dRow["ip_last"]), "Publicité.", Expire);
- GetClient().Disconnect();
- }
- if (nopub > 1)
- {
- GetClient().SendMessage(new RoomNotificationComposer("Robot Antipub",
- "<b>Attention " + GetClient().GetHabbo().Username + " !</b>\n" +
- "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" +
- "\n\n", "pub", "J'ai compris.", "event:close"));
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine("[ANTIPUB] Mot filtré de (" + Client.GetHabbo().Username + ")");
- }
- else
- {
- GetClient().SendMessage(new RoomNotificationComposer("Robot Antipub",
- "<b>Attention " + GetClient().GetHabbo().Username + " !</b>\n" +
- "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" +
- "\n\n", "pub", "J'ai compris.", "event:close"));
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine("[ANTIPUB] Mot filtré de (" + GetClient().GetHabbo().Username + ")");
- }
- Message = "# Filtré par l'antipub #";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment