
   /*
       Remote Cvar 0.1
       Copyleft jghg
       2003
       Clients with access ADMIN_CVAR can with this plugin
       access remote cvars of the server directly through
       console. No more need of rcon or typing "amx_cvar"
       before the cvar!
       Cvars can be returned, or set as usual.
       VERSIONS
       ========
       0.1            First version
   */
   #include <amxmod>
   #define MAXARGS 2
   #define MAXLENGTH 100
   #define CVARVALUEMAXLENGTH 100
   public client_command(id) {
       // Check access
       if ( !(get_user_flags(id) & ADMIN_CVAR) ){
           //console_print(id,"[Remote Cvar] You have no access to server
   cvars.")
           return PLUGIN_CONTINUE
       }
       new argCount = read_argc()
       // Get args
       new args[MAXARGS][MAXLENGTH]
       for (new i = 0;i < argCount;i++) {
           read_argv(i,args[i],MAXLENGTH - 1)
           if (i == 0) {
               //  Check  that  first  arg  exists  as cvar, or quit here
   already.
               if (!cvar_exists(args[0])) {
                   //client_print(id,print_console,"DEBUG   (remotecvar):
   Not a cvar that exists, quitting.")
                   return PLUGIN_CONTINUE
               }
               //else
                   //client_print(id,print_console,"[Remote  Cvar]  Found
   matching cvar.")
           }
       }
       if (argCount == 1) {
           new cvarValue[CVARVALUEMAXLENGTH]
           get_cvar_string(args[0],cvarValue,CVARVALUEMAXLENGTH - 1);
           client_print(id,print_console,"[Remote     Cvar]    '%s'    is
   '%s'.",args[0],cvarValue)
           return PLUGIN_CONTINUE
       }
       else if (argCount == 2) {
           set_cvar_string(args[0],args[1])
           client_print(id,print_console,"[Remote   Cvar]   '%s'  set  to
   '%s'.",args[0],args[1])
       }
       return PLUGIN_CONTINUE
   }
   public plugin_init() {
       register_plugin("Remote Cvar","0.1","jghg")
       return PLUGIN_CONTINUE
   }
