
   /* AMX Plugin
   *
   * (c) Copyright 2003, Bad HAL 9000
   * This file is provided as is (no warranties).
   *
   * This is the final version I think. I may update it in the future
   * It works now and has a nice balance to it.
   * Allowing the server admin to chose what happens
   * To the pigs on his server.
   *
   * Credits:
   * BAILOPAN: for helping me figure out logging :)
   * f117bomb: for the "Say BS" plugin code which I based this off of
   * FreeCode: for helping me debug my horrid coding :p
   *
   * Instructions:
   *  This  version  has 3 different methods of punishment for the racist
   defined by a cvar
   * sv_bigotmode <1, 2, or 3>
   *
   * 1 - Bans the offender for 48 hours
   * 2 - Kicks the offender off the server
   * 3 - Bans the offender PERMANTLY
   *
   * Defualt mode is 1 - ban offender for 48 hours
   *
   *    This    logs    all    bans/kicks   and   what   they   said   in
   /addons/amx/logs/bigotban.log
   *
   */
   #include <amxmod>
   new phrase[4][] = {"chink", "nigg","africoon","niger"}
   public plugin_init()
   {
       register_plugin("Anti Biggot","1.0B","Bad HAL 9000")
       register_clcmd("say","say_event")
       register_cvar("sv_bigotmode","1")
       return PLUGIN_CONTINUE
   }
   public say_event(id)
   {
       new sid[10]
       num_to_str(id,sid,10)
       new said[192]
       read_args(said,191)

       for(new i = 0 ;i < 4; i++) {
       if(containi(said,phrase[i]) != -1) {
           new authtoban[32]
           new pigname[32]
           id = str_to_num(sid)
           get_user_name(id,pigname,31)
           get_user_authid(id,authtoban,31)

           if(get_cvar_num("sv_bigotmode") == 1) {
           console_print(id,"[AMX]  You  were  automaticly  banned for 48
   hours for using a racist comment.")
           client_print(0,print_chat,   "[AMX]   ^"%s^"  was  automaticly
   banned for 48 hours for using racism",pigname)
           server_cmd("banid 2880 ^"%s^" kick;wait;writeid",authtoban)
           log_to_file("bigots.log",   "Banned   ^"%s:%s^"   for   saying
   **^"%s^"** for 48 hours", pigname, authtoban, said)
           }
           else if(get_cvar_num("sv_bigotmode") == 2) {
           console_print(id,"[AMX]  You were automaticly kicked for using
   a racist comment.")
           client_print(0,print_chat,   "[AMX]   ^"%s^"  was  automaticly
   kicked for using racism",pigname)
           server_cmd("kick %s",authtoban)
           log_to_file("bigots.log",   "Kicked   ^"%s:%s^"   for   saying
   **^"%s^"**", pigname, authtoban, said)
           }
           else if(get_cvar_num("sv_bigotmode") == 3) {
           console_print(id,"[AMX]  You were automaticly banned permantly
   for using a racist comment.")
           client_print(0,print_chat,   "[AMX]   ^"%s^"  was  automaticly
   banned permantly for using racism",pigname)
           server_cmd("banid 0 ^"%s^" kick;wait;writeid",authtoban)
           log_to_file("bigots.log",   "Banned   ^"%s:%s^"   for   saying
   **^"%s^"** PERMANT BAN", pigname, authtoban, said)
           }

       }
   }
   }
