
   /*********************************************************************
   ******
   *  amx_ejl_logallsay.sma
   *   version 1.2            Date: 10/29/2002
   *   Author: Eric Lidman     ejlmozart@hotmail.com
   *   Alias: Ludwig van       Upgrade:
   http://lidmanmusic.com/cs/plugins.html
   *
   *  Its simple really, no commands, it just logs everything said on the
   *   server  to a single file every day. Everything includes admin_tsay
   etc.
   *   It writes in the format:
   *
   *    month/date/year time  command(like say)  authid   name   what was
   said
   *
   *  Setup:
   *   Important:  For  the  logging  to  work,  you  need to set up some
   folders
   *   on your server. You need: ../%moddir%/admin_logs/say_logs
   *
   *     example:      ../cstrike/admin_logs/say_logs
   *
   **********************************************************************
   *****/
   #include <amxmod>
   public plugin_init() {
       register_plugin("EJL Log all say","1.2","EJL")
       register_clcmd("amx_tsay", "HandleSay")
       register_clcmd("amx_csay", "HandleSay")
       register_clcmd("amx_fsay", "HandleSay")
       register_clcmd("amx_scrollsay","HandleSay")
       register_clcmd("amx_tsayy", "HandleSay")
       register_clcmd("amx_csayy", "HandleSay")
       register_clcmd("amx_fsayy", "HandleSay")
       register_clcmd("amx_scrollsayy","HandleSay")
       register_clcmd("tsay", "HandleSay")
       register_clcmd("csay", "HandleSay")
       register_clcmd("fsay", "HandleSay")
       register_clcmd("scrollsay","HandleSay")
       register_clcmd("tsayy", "HandleSay")
       register_clcmd("csayy", "HandleSay")
       register_clcmd("fsayy", "HandleSay")
       register_clcmd("scrollsayy","HandleSay")
       register_clcmd("psay", "HandleSay")
       register_clcmd("amx_chat", "HandleSay")
       register_clcmd("amx_say", "HandleSay")
       register_clcmd("amx_psay", "HandleSay")
       register_clcmd("amx_vote", "HandleSay")
       register_clcmd("amx_mymotd","HandleSay")
       register_clcmd("say_team", "HandleSay")
       register_clcmd("say", "HandleSay")
       register_srvcmd("botsay","handle_botsayplugin")
       new ThisMap[32]
       get_mapname(ThisMap,31)
       new saylog[192]
       new filename[100]
       get_time("admin_logs/say_logs/%Y-%m-%d--allsay.log",filename,99)
       format(saylog,191,"START MAP:  %s",ThisMap)
       log_to_file(filename, saylog)
       return PLUGIN_CONTINUE
   }
   public handle_botsayplugin(){
       new arg0[8]
       read_argv(1,arg0,7)
       new iarg0 = strtonum(arg0)
       new sarg2[192]
       read_args(sarg2,191)
       new arg1[8]
       read_argv(2,arg1,7)
       new iarg1 = strtonum(arg1)
       if(is_user_bot(iarg1)){
           new OnlySay[128]
           new CMD[8]
           new len = strlen(sarg2)
           new start = contain(sarg2,":    ")
           copy(OnlySay,len-start+5,sarg2[start+5])
           copy(CMD,6,"BOTSAY")
           if(HandleSay2(iarg1,CMD,OnlySay))
               server_cmd("botsayreturn %d 1",iarg0)
       }
       return PLUGIN_CONTINUE
   }
   public HandleSay(id){
       new Speech[192],Command[32]
       read_argv(0,Command,31)
       read_args(Speech,191)
       remove_quotes(Speech)
       if(HandleSay2(id,Command,Speech))
           return PLUGIN_HANDLED
       return PLUGIN_CONTINUE
   }
   HandleSay2(id,Command[],Speech[]){
       new User[32]
       new AUTHID[32]
       new saylog[192]
       new filename[100]
       get_time("admin_logs/say_logs/%Y-%m-%d--allsay.log",filename,99)
       get_user_authid(id,AUTHID,31)
       get_user_name(id,User,31)
       format(saylog,  191,  "%s  %s  ........ %s .................. %s",
   Command, AUTHID, User, Speech)
       log_to_file(filename, saylog)
       return PLUGIN_CONTINUE
   }
