
   /* AMX Mod Script.
   *
   * (c) Copyright 2002-2003, Sai
   * This file is provided as is (no warranties).
   *
   */
   #include <amxmod>
   #include <amxmisc>
   #define MAX_TAGS 100
   /* max. number of entries in clanmembers.ini */
   new clanmembers[] = "addons/amx/clanmembers.ini"
   new ipstore[MAX_TAGS][16]
   new namestore[MAX_TAGS][32]
   new bool:dontcheck[33]
   new num_words
   read_list(filename[]){
       if (file_exists(filename)){
           new readdata[64], len, pos = 0
           while (num_words < MAX_TAGS &&
   read_file(filename,pos++,readdata,63,len)){
               parse(readdata,                   namestore[num_words],31,
   ipstore[num_words],15)
               ++num_words
           }
       }
       else
           log_message("Nickname and Clantag Registration: File not found
   (file ^"%s^")",filename)
   }
   public amx_tagbase(id,level,cid){
       if (!cmd_access(id,level,cid,1))
           return PLUGIN_HANDLED
       console_print(id,"Nickname     and     Clantag     Database^n%-32s
   %s","NICK/TAG","IP")
       for(new a=0; a<num_words; ++a)
           console_print(id,"%-32s %s", namestore[a], ipstore[a])
       console_print(id,"Total %d",num_words)
       return PLUGIN_HANDLED
   }
   public client_infochanged(id){
      if (dontcheck[id])
         dontcheck[id] = false
      else if (is_user_connected(id) && get_cvar_float("amx_tagreg")){
         new newname[32], oldname[32]
         get_user_info(id, "name", newname,31)
         get_user_name(id,oldname,31)
         if (!equal(oldname,newname)){
            dontcheck[id] = true
            client_print(id,print_chat,"*  You  are not allowed to change
   your name")
            set_user_info(id,"name",oldname)
         }
      }
      return PLUGIN_CONTINUE
   }
   public client_connect(id){
       if (!get_cvar_float("amx_tagreg"))
           return PLUGIN_CONTINUE
       client_cmd(id,"echo ** You can't change your Nickname in game!")
       new userip[16],name[32], output = 0
       get_user_name(id,name,31)
       get_user_ip(id,userip,15,1)
       for(new i=0; i<num_words; ++i){
           if ( containi(name,namestore[i])!=-1 ){
               output = 1
               if (equal(userip,ipstore[i]))
                   output = 2
           }
       }
       switch(output){
       case  2:  client_cmd(id,"echo  **  Your Nickname/Clantag & IP have
   been authorized!")
       case 1:{
           client_cmd(id,"echo  ** Your Nickname/Clantag is registered on
   this server to another player, you cannot use it!; disconnect")
           client_print(0,print_chat,"**   %s  was  kicked  from  server,
   Nickname/Clantag is registered to another player", name)
       }
       default:    client_cmd(id,"echo   **   Nickname/Clantag   is   not
   registered, welcome to the server")
       }
       return PLUGIN_CONTINUE
   }
   public plugin_init() {
       register_plugin("Nickname   and  Clantag  Registration","2.7","Sai
   (modified)")
       register_concmd("amx_tagbase","amx_tagbase",ADMIN_LEVEL_A,"-  show
   registered user with these ip")
       register_cvar("amx_tagreg","0")
       read_list(clanmembers)
       return PLUGIN_CONTINUE
   }
