
   /* AMXMOD script.
   *
   * (c) Copyright 2000-2002, Sai
   * This file is provided as is (no warranties).
   *
   *
   *
   * Changelog:
   *
   *  1.0  - Initial Relase created by Sai (based on amx_who.sma)
   */
   /*********************************************************************
   **
   *  Important: For the logging to work, you need to set up some folders
   *   on your server. You need: ../%moddir%/admin_logs/id_logs
   *
   *     example:      ../cstrike/admin_logs/id_logs
   *
   **********************************************************************
   /
   #include <amxmod>
   public plugin_init()
   {
      register_plugin("WhoPlayerIPTracking", "1.0", "Sai")
      register_clcmd("amx_ips",       "admin_whoplayer",       ADMIN_BAN,
   "amx_ips  :  Find out players IP.")
      new ThisMap[33]
      get_mapname(ThisMap,33)
      new idlog[192]
      new logtime[64]
      new filename[100]
      get_time("%m/%d/%Y  %H:%M",logtime,64)
      get_time("admin_logs/id_logs/%Y-%m-%d--id.log",filename,100)
      format(idlog,192,"%s  START MAP:  %s", logtime,ThisMap)
      write_file(filename, idlog, -1)
      return PLUGIN_CONTINUE
   }
   public admin_whoplayer(id){
      new j
      new maxpl = get_playersnum()
      new Name[32]
      new AuthIP[16]
      new player
      client_print(id,print_console,"^nCurrent Name  --  IP")
       for (j = 1; j <= maxpl; j++) {
         get_user_ip(j,AuthIP,16,1)
         get_user_name(j,Name,32)
         player = find_player("a",Name)
      if (player){
         client_print(id,print_console, "%s -- IP: %s", Name, AuthIP)
       }
      }
      return PLUGIN_HANDLED
   }
   public client_connect(id){
      new User[32]
      new AUTHIP[16]
      new idlog[192]
      new logtime[64]
      new filename[100]
      get_time("%m/%d/%Y  %H:%M",logtime,64)
      get_time("admin_logs/id_logs/%Y-%m-%d--id.log",filename,100)
      get_user_ip(id,AUTHIP,16,1)
      get_user_name(id,User,32)
      format(idlog, 192, "%s  %s  %s",logtime, AUTHIP, User)
      write_file(filename, idlog, -1)
      return PLUGIN_CONTINUE
   }
   public client_disconnect(id){
      return PLUGIN_CONTINUE
   }
