
   //
   //
   //     This plugin must be loaded SECOND (right after admin.amx) or at
   //     least before the plugins containg the commands you want to
   //     have this plugin affect, such as the AMX default plugins in
   //     your PLUGINS.INI or it wont work.
   //
   //
   /*********************************************************************
   **
   * amx_ejl_adminhierarchy.sma     release version 1.7  November 21/2002
   *  By:  Eric Lidman    Alias: Ludwig van
   *  Upgrade: http://lidmanmusic.com/cs/plugins.html
   *
   *  *** Converted from my old adminmod plugin which does the same. ***
   *  *** See below for changelog
   *
   * This plugin performs much the same function as the old adminmod cvar
   *  admin_highlander, except it is more flexible. It allows a group of
   *  top   admins  to  have  their  complete  access  (as  specified  in
   admin.cfg,
   *  but no more) to amx commands, while admins not in the group will
   *  only  have  limited  access based on whateve admins above them that
   are
   *  present.
   *
   * Adminhierarchy should be useful for servers with many admins. Only
   *  admins  in  the  top  rank who are on at the time will have control
   over
   *  the more "global" commands on the server -- commands which directly
   *  affect more than one player such as amx_cvar or amx_map.
   *  This way admins can argue about what the gravity will be, but only
   *  the  top  admins can do anything about it -- until they leave, then
   the
   *  next  highest  admin  in  the  ranks  takes control. It is aimed at
   keeping
   *  order  on  the  server.  Commands  such  as slay, kick, ban are not
   limited
   *  by  this  plugin  so  that  lower  admins  can  still do thier jobs
   policing
   *  the  game  so  to  speak,  just  not  controlling  it.  There is an
   exception
   *  to this rule: if a command, like slay is directed at a whole team,
   *  then  the  admin  issuing it has to be the leading admin playing as
   this
   *  directly affects more than one player.
   *
   * This plugin also gives partial immunity to all admins. No one can
   *  amx_ban, amx_kick, or amx_vote_kick any admin. Admins without
   *  immunity in their access can still be slapped, slayed etc. This is
   *  just a precaution to keep lower admins from gaining power by
   *  kicking/banning higher admins.
   *
   * Commands:
   *
   *  amx_signin      ---  tells  the server you are on and ready to take
   your
   *                      place in the admin hierarchy, low or high. This
   is
   *                      not  required  if  you  are  using  the default
   scheme
   *                      of having the server automatically sign you in.
   *  amx_resign      ---  used  by  a higher admin to let the next lower
   admin
   *                      be  the  top  admin  while  the higher admin is
   still
   *                      connected.  This  is for all your either humble
   or
   *                      lazy  higher  admins out there who dont want to
   be
   *                      the higher admin for the moment.
   *  amx_topadmin    ---  use this to find out who the current top admin
   is.
   *  amx_adminstatus    ---  Lists  admins  who are currently playing in
   rank
   *                         order  and  reports if they are signed in or
   not.
   *                         A  regular  player looking at this will only
   see
   *                         admins   who   have   their  access  active,
   although
   *                         the admins dont need to be signed in. Admins
   *                         with thier access active from the admin.cfg
   *                         looking   at   this   will  see  all  admins
   connected
   *                         even  if  the  othe  admin do not have their
   admin
   *                         access in the admin.cfg active.
   *  amx_cloak_owner        ---  Makes  the  number 1 admin invisible to
   the
   *                             other admins. He wont be reported at all
   *                             and will not be signed in automatically
   *                             even if auto-signin is the current mode.
   *                             If  you  decide to sign in, however, you
   will
   *                             be  exposed.  But thats not the point of
   this.
   *                             This  allows  for  the  server  owner to
   watch
   *                             stealthily over his admins while playing
   *                             under  a  fake name. The command toggles
   on
   *                             and off stealth mode and sets it in the
   *                             ejl_vault.ini   as   the  default  until
   changed.
   *                             Only the #1 admin can do this command.
   *                             If you run any plugins which announce
   *                             admin's  entrances,  you  will  want  to
   modify
   *                             them  in  such  a  way  that  they  dont
   announce
   *                             you,  or  disable  them  altogether.  Of
   course
   *                             you  would  only  need to do this if you
   want
   *                             to use the cloak owner mode. Obviosly an
   *                             annouced entrance could blow your cover.
   * amx_signin_default      --- Toggles auto-signin mode on and off and
   *                             sets  it  in  the  ejl_vault.ini  as the
   default
   *                             until  it  is  changed  again.  Only the
   server
   *                             owner can set this mode on or off.
   *                             AMX ADMIN_RCON access required.
   *  amx_ah_reload           ---  Reloads the adminhierarchy.txt file so
   that
   *                             changes made to it midway through a game
   *                             can  be  effective  immediately  without
   having
   *                             to  wait  for  a  map  change.  Only the
   server
   *                             owner is allowed to use this command.
   *                             AMX ADMIN_RCON access required.
   * amx_ah_report           --- Toggles the use of messeges telling when
   *                             admins sign in, resign, connect, or
   *                             disconnect and sets it in the vault as
   *                             the default until it is changed again.
   *                             This cuts down on chat use by the plugin
   *                             and the bombarding of players with admin
   *                             information  if  thats  the way you like
   it.
   *                             The commands, admin_adminstatus and
   *                             admin_topadmin   still  work.  Only  the
   server
   *                             owner can set this mode on or off.
   *                             AMX ADMIN_RCON access required.
   *  amx_ah_guest           ---  If  you are using a create admin on the
   fly
   *                             plugin you can enable guest mode so that
   *                             you  do  not  need  to set the temporary
   admin
   *                             up in the adminhierarchy.txt. The temp
   *                             admin   is   considered  last  in  rank.
   Command
   *                             toggles  guest  mode on and off. Default
   off.
   *                             AMX ADMIN_RCON access required.
   *
   * By default, this plugin tries to automatically sign in admins on
   *  their connect. Also by default owner cloaking is off and use of
   *  messenging (admin_ah_report) is on. It is possible in cloak mode
   *  for a server owner to allow himself to be kicked (but not banned)
   *  by one of his admins. This is useful if you want to observe them
   *  extensively and not raise thier suspicions as they kick you. Then
   *  of course you can tell them later that they kicked you. (Then fire
   *  them.  lol)  By default in cloak mode you cant be kicked, but there
   is
   *  a switch below you can set to be in allow kick mode. If you change
   *  it, you need to recompile the plugin. The switch looks like this:
   *  #define AllowOwnerKick 0 // 0=no 1=yes
   *
   *  This  plugin uses AUTHIDS's for admin identification so it WILL NOT
   WORK
   *  for LAN games. AUTHIDS's for your admins MUST be entered into the
   *  adminhierarchy.txt  file  and  that file must be in the folder with
   all
   *  your other amx configs. ../addons/amx   AUTHID's by the way can be
   *  either SteamID's or WONIDS. For most of you that means WONID.
   *
   * How to set up adminhierarchy.txt:
   *
   *  At  the  beginning  of each map, this file is read by the server to
   see
   *   how  it  should  treat  the  admins. The format of the file is one
   admin
   *   for  each  line. Rank numbers are not given, it just goes in order
   top
   *   to bottom. First there is a number 1 or 2 to identify admin type
   *   (then a space), next is the admin's wonid (then a space), next is
   *   optional  --  the admin's name just so it is easier for you to see
   who
   *   is who in the order. The name is not important to the plugin. Type
   1
   *   admins  are  those who are not limited by this plugin. They can be
   on
   *   the server all at the same time and all issue "global" commands.
   *   Type  2  admins are the reason for this plugin in the first place.
   If
   *   an  admin  ranking  higher  than them is on, all the lower ranking
   type 2
   *   admins will have their power limited by this plugin. All type 1
   *   admins should be listed first, then type 2 in rank order.
   *
   *    example of adminhierarchy.txt contents:
   *
   *    1 123454   mynamecuzimtheowner
   *    1 527373   anothername
   *    1 43498    anotherhighadmin
   *    2 8994422  thehiestlowadmin
   *    2 33743    anyoldadmin
   *    2 748433   howiecarr
   *    2 1277344  yetanotheradmin
   *
   * Advanced set-up adminhierarchy.txt:
   *
   *  It is possible to have several different levels of type 1 admins,
   *   those that can operate together at the same time. Type 1 is the
   *   highest group of admins. If a type 1 admin is signed in, no one
   *   outside of another type one admin will have full power. Type "a"
   *   is the next group of admins, if no type 1's are signed in, then
   *   all type "a" admins are treated equal in rank just as type i's
   *   were. There are two more shared power groups, type "b" and type
   *   "c". The rules are the same. If anyone from a higher group is
   *   signed in, only the highest group has full access. Type 2 is the
   *   same as before, individual admins hight one over lower one. Admins
   *   must  still  be  listed  in rank order and group order must not be
   mixed
   *   up. If you put a type "c" before a type 1 in the list, there will
   *   be a malfunction.
   *
   *    advanced example of adminhierarchy.txt contents:
   *
   *    1 123454   mynamecuzimtheowner
   *    1 527373   anothername
   *    1 43498    anotherhighadmin
   *    a 452014   adminingroupA
   *    a 3426551  adminequalingroupA
   *    a 34342    anotherAname
   *    b 523456   thegroupBadminsname
   *    b 434901   anmtherBname
   *    2 8994422  thehiestlowadmin
   *    2 33743    anyoldadmin
   *    2 748433   howiecarr
   *    2 1277344  yetanotheradmin
   *
   * Changelog:
   *   Dec.7, 2002  * miscount of admins fixed
   *                * misleading info given on admin disconnect fixed
   *                * error log file is now accesible while hlds runs
   *                * more commands added to limitation list
   *   Feb.12 2003  * more commands added to limitation list
   *                * bug fix in non admin kicking function
   *   Mar. 1 2003  * Added more admin groups, added a guest admin mode
   *
   **********************************************************************
   /
   #include <amxmod>
   #include <amxmisc>
   #define  AllowOwnerKick 0 // 0=no 1=yes  'yes' lets owner be kicked in
   cloak mode
   new AdminOn[100]
   new AdminResign[100]
   new AdminType[100][2]
   new AdminInfo[100][39]
   new AdminName[100][33]
   new TotalAdmins
   new bool:bAutoSignIn = true
   new bool:bCloakOwner = false
   new bool:bReportS = true
   new bool:bGuest = false
   new vault_value[128]
   public plugin_init(){
       register_plugin("Admin Ranking System","0.9","EJL")
       register_clcmd("amx_signin",       "admin_signin",      ADMIN_MAP,
   "amx_signin  :  Tells  the  server  he  is  here  and  in  the pool of
   possible top admins.")
       register_clcmd("amx_resign",       "admin_resign",      ADMIN_MAP,
   "amx_resign  :  Lets   the   next  lowest  admin  be  the  high  admin
   instead.")
       register_clcmd("amx_topadmin",    "admin_topadmin",    ADMIN_USER,
   "amx_topadmin  :  Find out who is the top admin currently playing.")
       register_clcmd("amx_adminstatus", "admin_adminstatus", ADMIN_USER,
   "amx_adminstatus  :  Find out what admins are currently playing and if
   they are signed in.")
       register_clcmd("amx_signin_default",         "admin_signin_deflt",
   ADMIN_RCON,  "amx_signin_default : Toggles the signin mode and sets it
   as the default.")
       register_clcmd("amx_ah_report",   "admin_ah_report",   ADMIN_RCON,
   "amx_ah_report  :  Toggles  the  reporting  of  signin,  signout,  and
   topadmin on and off. Sets as default.")
       register_clcmd("amx_ah_guest",    "admin_ah_guest",    ADMIN_RCON,
   "amx_ah_guest : Toggles on and off guest admin mode.")
       register_clcmd("amx_ah_reload",   "admin_ah_reload",   ADMIN_RCON,
   "amx_ah_reload  :  Reloads  Adminhierarchy.txt  in  the  middle  of  a
   round.")
       register_clcmd("amx_cloak_owner",  "admin_cloak_own",  ADMIN_RCON,
   "amx_cloak_owner  : Toggles server owner cloak mode and sets it as the
   default.")
       register_clcmd("say","handle_say")
   // global commands for top admins only
   //
       register_clcmd("amx_map","AdminHierarchy")
       register_clcmd("amx_cvar","AdminHierarchy")
       register_clcmd("amx_pause","AdminHierarchy")
       register_clcmd("amx_cfg","AdminHierarchy")
       register_clcmd("amx_rcon","AdminHierarchy")
       register_clcmd("amx_restartround","AdminHierarchy")
       register_clcmd("amx_awp","AdminHierarchy")
       register_clcmd("amx_pistols","AdminHierarchy")
       register_clcmd("amx_scopes","AdminHierarchy")
       register_clcmd("amx_rifles","AdminHierarchy")
       register_clcmd("amx_restrict","AdminHierarchy")
       register_clcmd("amx_alltalk","AdminHierarchy")
       register_clcmd("amx_restart","AdminHierarchy")
       register_clcmd("amx_restartround","AdminHierarchy")
       register_clcmd("amx_gravity","AdminHierarchy")
       register_clcmd("amx_airaccelerate","AdminHierarchy")
       register_clcmd("amx_timelimit","AdminHierarchy")
       register_clcmd("amx_roundtime","AdminHierarchy")
       register_clcmd("amx_buytime","AdminHierarchy")
       register_clcmd("amx_freezetime","AdminHierarchy")
       register_clcmd("amx_c4timer","AdminHierarchy")
       register_clcmd("amx_maxrounds","AdminHierarchy")
       register_clcmd("amx_forcecamera","AdminHierarchy")
       register_clcmd("amx_forcechasecam","AdminHierarchy")
       register_clcmd("amx_fadetoblack","AdminHierarchy")
       register_clcmd("amx_friendlyfire","AdminHierarchy")
       register_clcmd("amx_limitteams","AdminHierarchy")
       register_clcmd("amx_tkpunish","AdminHierarchy")
       register_clcmd("amx_hostagepenalty","AdminHierarchy")
       register_clcmd("sv_restart","AdminHierarchy")
       register_clcmd("sv_restartround","AdminHierarchy")
       register_clcmd("sv_gravity","AdminHierarchy")
       register_clcmd("sv_airaccelerate","AdminHierarchy")
       register_clcmd("mp_timelimit","AdminHierarchy")
       register_clcmd("mp_roundtime","AdminHierarchy")
       register_clcmd("mp_buytime","AdminHierarchy")
       register_clcmd("mp_freezetime","AdminHierarchy")
       register_clcmd("mp_c4timer","AdminHierarchy")
       register_clcmd("mp_maxrounds","AdminHierarchy")
       register_clcmd("mp_forcecamera","AdminHierarchy")
       register_clcmd("mp_forcechasecam","AdminHierarchy")
       register_clcmd("mp_fadetoblack","AdminHierarchy")
       register_clcmd("mp_friendlyfire","AdminHierarchy")
       register_clcmd("mp_limitteams","AdminHierarchy")
       register_clcmd("mp_tkpunish","AdminHierarchy")
       register_clcmd("mp_hostagepenalty","AdminHierarchy")
       register_clcmd("allow_spectators","AdminHierarchy")
       register_clcmd("amx_startmatch","AdminHierarchy")
       register_clcmd("amx_stack","AdminHierarchy")
       register_clcmd("amx_knifea","AdminHierarchy")
       register_clcmd("stopbombvote","AdminHierarchy")
       register_clcmd("stopmapvote","AdminHierarchy")
       register_clcmd("stopvote","AdminHierarchy")
       register_clcmd("amx_votes","AdminHierarchy")
       register_clcmd("amx_ptb","AdminHierarchy")
       register_clcmd("amx_ct","AdminHierarchy")
       register_clcmd("amx_t","AdminHierarchy")
       register_clcmd("amx_slay","AdminHierarchy")
       register_clcmd("amx_slay2","AdminHierarchy")
       register_clcmd("amx_godmode","AdminHierarchy")
       register_clcmd("amx_maxspeed","AdminHierarchy")
       register_clcmd("amx_noclip","AdminHierarchy")
       register_clcmd("amx_heal","AdminHierarchy")
       register_clcmd("amx_slap","AdminHierarchy")
       register_clcmd("amx_gag","AdminHierarchy")
       register_clcmd("amx_ungag","AdminHierarchy")
       register_clcmd("amx_bury","AdminHierarchy")
       register_clcmd("amx_unbury","AdminHierarchy")
       register_clcmd("amx_leave","AdminHierarchy")
       register_clcmd("amx_hook","AdminHierarchy")
       register_clcmd("amx_hookmod","AdminHierarchy")
       register_clcmd("amx_hook_deployspeed","AdminHierarchy")
       register_clcmd("amx_hook_speed","AdminHierarchy")
       register_clcmd("amx_hook_ground","AdminHierarchy")
       register_clcmd("amx_hook_showspy","AdminHierarchy")
       register_clcmd("amx_hook_sound","AdminHierarchy")
       register_clcmd("amx_hook_hold","AdminHierarchy")
       register_clcmd("amx_hook_sky","AdminHierarchy")
       register_clcmd("amx_hook_players","AdminHierarchy")
       register_clcmd("amx_hook_onlywalls","AdminHierarchy")
       register_clcmd("amx_hook_color","AdminHierarchy")
       register_clcmd("amx_hook_gravity","AdminHierarchy")
       register_clcmd("amx_hook_mode","AdminHierarchy")
       register_clcmd("amx_hook_wait","AdminHierarchy")
       register_clcmd("amx_hook_forcespeed","AdminHierarchy")
       register_clcmd("amx_hook_width","AdminHierarchy")
       register_clcmd("amx_hook_noise","AdminHierarchy")
       register_clcmd("amx_hookvote","AdminHierarchy")
       register_clcmd("amx_hook_count","AdminHierarchy")
       register_clcmd("amx_playsounds","AdminHierarchy")
       register_clcmd("amx_nukem","AdminHierarchy")
       register_clcmd("amx_nukem_jk","AdminHierarchy")
       register_clcmd("amx_ghosts","AdminHierarchy")
       register_clcmd("amx_rope","AdminHierarchy")
       register_clcmd("amx_rope_count","AdminHierarchy")
       register_clcmd("amx_ropevote","AdminHierarchy")
       register_clcmd("amx_menu","AdminHierarchy")
       register_clcmd("amxmodmenu","AdminHierarchy")
       register_clcmd("amx_pausemenu","AdminHierarchy")
       register_clcmd("amx_restmenu","AdminHierarchy")
       register_clcmd("amx_cvarmenu","AdminHierarchy")
       register_clcmd("amx_cmdmenu","AdminHierarchy")
       register_clcmd("amx_cfgmenu","AdminHierarchy")
       register_clcmd("amx_mapmenu","AdminHierarchy")
   //    register_menucmd(register_menuid("\yAdmin
   Menu"),1023,"AdminHierarchy")
   //    register_menucmd(register_menuid("\yCmd
   Menu"),1023,"AdminHierarchy")
   //    register_menucmd(register_menuid("\yMap
   Menu"),1023,"AdminHierarchy")
   //    register_menucmd(register_menuid("\yPlayer
   Menu"),1023,"AdminHierarchy_2")
   //    register_menucmd(register_menuid("\yCvar
   Menu"),1023,"AdminHierarchy")
   //    register_menucmd(register_menuid("AMX                      Admin
   Menu"),1023,"AdminHierarchy")
   //    register_menucmd(register_menuid("AMX                        Cmd
   Menu"),1023,"AdminHierarchy")
   //    register_menucmd(register_menuid("AMX                        Map
   Menu"),1023,"AdminHierarchy")
   //    register_menucmd(register_menuid("AMX                     Player
   Menu"),1023,"AdminHierarchy_2")
   //    register_menucmd(register_menuid("AMX                       Cvar
   Menu"),1023,"AdminHierarchy")
       register_clcmd("amx_extendmap","AdminHierarchy")
       register_clcmd("amx_mapbounds","AdminHierarchy")
       register_clcmd("amx_timebombs","AdminHierarchy")
       register_clcmd("amx_timebomb_credit","AdminHierarchy")
       register_clcmd("amx_matrix","AdminHierarchy")
       register_clcmd("amx_dice","AdminHierarchy")
       register_clcmd("amx_scotty_off","AdminHierarchy")
       register_clcmd("amx_scotty_on","AdminHierarchy")
       register_clcmd("amx_scotty_unlimited","AdminHierarchy")
       register_clcmd("amx_scotty_crazy","AdminHierarchy")
       register_clcmd("amx_scotty_insane","AdminHierarchy")
       register_clcmd("amx_drunkmode_all","AdminHierarchy")
       register_clcmd("amx_fireworks_sound","AdminHierarchy")
       register_clcmd("amx_flamethrowers","AdminHierarchy")
       register_clcmd("amx_flamethrowers_cost","AdminHierarchy")
       register_clcmd("amx_flamethrowers_buytype","AdminHierarchy")
       register_clcmd("amx_jetpacks","AdminHierarchy")
       register_clcmd("amx_jetpacks_cost","AdminHierarchy")
       register_clcmd("amx_jetpacks_buytype","AdminHierarchy")
   // protect the admins without giving them full immunity
   //
       register_clcmd("amx_ban","CantBanMe")
       register_clcmd("amx_banip","CantBanMe")
       register_clcmd("amx_kick","CantBanMe")
       register_clcmd("amx_votekick","CantBanMe")
       register_clcmd("amx_voteban","CantBanMe")
       register_clcmd("amx_kickmenu","CantBanMe")
       register_clcmd("amx_banmenu","CantBanMe")
       register_clcmd("amx_slapmenu","CantBanMe")
       register_clcmd("amx_teammenu","CantBanMe")
       register_clcmd("amx_clcmdmenu","CantBanMe")
       register_clcmd("amx_goaway","CantBanMe")

       ejl_vault("READ","EJL_ADMINH_MODE","")
       if(equal(vault_value,"manual"))
           bAutoSignIn = false
       else
           bAutoSignIn = true
       ejl_vault("READ","EJL_ADMINH_REPORT","")
       if(equal(vault_value,"off"))
           bReportS = false
       else
           bReportS = true
       ejl_vault("READ","EJL_ADMINH_CLOAK","")
       if(equal(vault_value,"on"))
           bCloakOwner = true
       else
           bCloakOwner = false
       if(file_exists("addons/amx/adminhierarchy_error.log") == 1){
           delete_file("addons/amx/adminhierarchy_error.log")
       }
       if(file_exists("addons/amx/adminhierarchy.txt") == 1){
           new line = 0
           new data[128]
           new stextsize = 0
           while((line=read_file("addons/amx/adminhierarchy.txt",line,dat
   a,128,stextsize))!=0){
               if(    (equal(data,"1",1))   ||   (equal(data,"2",1))   ||
   (equali(data,"a",1))         ||         (equali(data,"b",1))        ||
   (equali(data,"c",1))  ){
                   TotalAdmins += 1
                   if(TotalAdmins < 100){
                            parse(data,     AdminType[TotalAdmins],    2,
   AdminInfo[TotalAdmins], 39, AdminName[TotalAdmins], 33)
                   }
               }
           }
       }else{
           write_file("addons/amx/adminhierarchy_error.log",   "****  EJL
   ADMIN  RANK  FILE  Format:  <admin  type  1  or  2>  <AUTHID or WONID>
   <NAME>   ****", -1)
           write_file("addons/amx/adminhierarchy_error.log",  "1.  Please
   create a text file called adminhierarchy.txt in this folder", -1)
           write_file("addons/amx/adminhierarchy_error.log",  "2. Here is
   an example of what the contents should be:", -1)
           write_file("addons/amx/adminhierarchy_error.log",  "1  2377813
   LudwigVan", -1)
           write_file("addons/amx/adminhierarchy_error.log",           "1
   263213  VodkaMaster", -1)
           write_file("addons/amx/adminhierarchy_error.log",  "2  3235683
   Vivaldi", -1)
           write_file("addons/amx/adminhierarchy_error.log",           "2
   12683   Trinot", -1)
           write_file("addons/amx/adminhierarchy_error.log",           "2
   984683  BATGIRL", -1)
       }
       return PLUGIN_CONTINUE;
   }
   public client_connect(id) {
       new i
       new UserName[33]
       new AUTHID[39]
       new FoundHi
       new HiAUTHID[39]
       new HiName[33]
       new iMaxPlayers = get_maxplayers() +1
       new Name[33]
       new Authid[33]
       new AdminDC
       new cloak
       get_user_name(id,UserName,33)
       get_user_authid(id, AUTHID,39)
       if(bCloakOwner == true){
           cloak = 2
       }else{
           cloak = 1
       }
       for (i = cloak; i <= TotalAdmins; i++) {
           if(equal(AUTHID, AdminInfo[i])){
               if(bAutoSignIn == true){
                   AdminDC =1
                   AdminOn[i] = 1
               }
               AdminResign[i] = 0
           }
           if(AdminOn[i] == 1){
               if(FoundHi == 0){
                   copy(HiAUTHID,39,AdminInfo[i])
                   FoundHi =1
               }
           }
       }
       for (i = 1; i <= iMaxPlayers; i++) {
           get_user_authid(i, Authid,39)
           get_user_name(i,Name,33)
                if(equal(Authid, HiAUTHID)){
               copy(HiName,33,Name)
           }
       }
       if(FoundHi==0){
           copy(HiName, 33, "... uh, there is none.")
       }
       i=1
       FoundHi = 0
       if (AdminDC==1){
           if(bReportS == true){
               if(equal(UserName, HiName)){
                   client_print(0,print_chat,"%s has signed in and is now
   top admin.", UserName)
               }else{
                   client_print(0,print_chat,  "%s signs in but top admin
   is still %s", UserName, HiName)
               }
           }
       }
       AdminDC=0
       return PLUGIN_CONTINUE
   }
   public client_disconnect(id) {
       new FoundHi
       new HiAUTHID[39]
       new HiName[33]
       new FoundHix
       new HiAUTHIDx[39]
       new HiNamex[33]
       new iMaxPlayers = get_maxplayers() +1
       new Name[33]
       new Authid[39]
       new i
       new cloak
       new AdminDC
       new AUTHID[39]
       new UserName[33]
       get_user_name(id,UserName,33)
       get_user_authid(id, AUTHID,39)
       if(bCloakOwner == true){
           cloak = 2
       }else{
           cloak = 1
       }
       for (i = cloak; i <= TotalAdmins; i++) {
           if(AdminOn[i] == 1){
               if(FoundHix == 0){
                   copy(HiAUTHIDx,39,AdminInfo[i])
                   FoundHix =1
               }
           }
           if(equal(AUTHID, AdminInfo[i])){
               AdminDC =1
               AdminOn[i] = 0
               AdminResign[i] = 0
           }
           if(AdminOn[i] == 1){
               if(FoundHi == 0){
                   copy(HiAUTHID,39,AdminInfo[i])
                   FoundHi =1
               }
           }
       }
       for (i = 1; i <= iMaxPlayers; i++) {
           get_user_authid(i, Authid,39)
           get_user_name(i,Name,33)
           if(equal(Authid, HiAUTHID)){
               copy(HiName,33,Name)
           }
               if(equal(Authid, HiAUTHIDx)){
               copy(HiNamex,33,Name)
           }
       }
       if(FoundHi==0){
           copy(HiName,33, "... uh, there is none.")
       }
       if (AdminDC==1){
           if(bReportS == true){
               if(equal(UserName, HiNamex)){
                   client_print(0,print_chat,"%s  has left. The top admin
   is now %s", UserName, HiName)
               }
           }
       }
       FoundHi = 0
       FoundHix = 0
       AdminDC=0
       return PLUGIN_CONTINUE
   }
   public handle_say(id){
       new Speech[192]
       read_args(Speech,192)
       if ((containi(Speech, "admin") != -1) && ((containi(Speech, "top")
   !=  -1)  ||  (containi(Speech,  "who")  !=  -1)  ||  (containi(Speech,
   "status") != -1) || (containi(Speech, "high") != -1)) ){
           admin_topadmin(id)
       }
       return PLUGIN_CONTINUE;
   }
   public AdminHierarchy(id){
       new i
       new cloak
       new COMauthid[39]
       new DenyAdmin
       new AllowCommand
       new FoundHi
       new Type1,TypeA,TypeB
       new HiAUTHID[39]
       new HiName[33]
       new iMaxPlayers = get_maxplayers() +1
       new Name[33]
       new Authid[39]
       get_user_authid(id,COMauthid, 39)
       if(bCloakOwner == true){
           cloak = 2
       }else{
           cloak = 1
       }
       if(bAutoSignIn == true){
           for (i = cloak; i <= TotalAdmins; i++) {
               if(equal(COMauthid, AdminInfo[i])){
                   AdminOn[i] = 1
                   AdminResign[i] = 0
               }
           }
       }
       for (i = 1; i <= TotalAdmins; i++) {
           if(AdminOn[i] == 1){
               if(FoundHi == 0){
                   copy(HiAUTHID,39,AdminInfo[i])
                   FoundHi =1
               }
               if((equal(AdminType[i],"1")) &&
   (equal(AdminInfo[i],COMauthid))){
                   AllowCommand = 1
                   DenyAdmin = 1
                   Type1 = 1
               }
               else            if((equali(AdminType[i],"a"))           &&
   (equal(AdminInfo[i],COMauthid)) && (Type1 == 0)){
                   AllowCommand = 1
                   DenyAdmin = 1
                   TypeA = 1
               }
               else            if((equali(AdminType[i],"b"))           &&
   (equal(AdminInfo[i],COMauthid)) && (Type1 == 0) && (TypeA == 0) ){
                   AllowCommand = 1
                   DenyAdmin = 1
                   TypeB = 1
               }
               else            if((equali(AdminType[i],"c"))           &&
   (equal(AdminInfo[i],COMauthid))  &&  (Type1  ==  0) && (TypeA == 0) &&
   (TypeB == 0)){
                   AllowCommand = 1
                   DenyAdmin = 1
               }
           }
           if(DenyAdmin == 0){
               if(AdminOn[i] == 1){
                   DenyAdmin = 1
                   if(equal(AdminInfo[i], COMauthid)) {
                       AllowCommand = 1
                   }
               }
           }
       }
       new arg[33]
       read_argv(0,arg,33)
       if(  (containi(arg,"slay")  != -1) || (containi(arg,"slap") != -1)
   || (containi(arg,"godmode") != -1) || (containi(arg,"gag") != -1) ||
           (containi(arg,"noclip") != -1) || (containi(arg,"heal") != -1)
   ||(containi(arg,"maxspeed") != -1) || (containi(arg,"bury") != -1) ){
              new arg1[12]
              read_argv(1,arg1,12)
              if (equal(arg1,"@",1)) {
               if(AllowCommand == 1){
                   AllowCommand = 0
                   DenyAdmin = 0
                   return PLUGIN_CONTINUE
               }else{
                   AllowCommand = 0
               }
           }else{
               return PLUGIN_CONTINUE
           }
       }
       if(AllowCommand == 1){
           AllowCommand = 0
           DenyAdmin = 0
           return PLUGIN_CONTINUE
       }
       if(DenyAdmin == 0){
           if(bGuest == false){
               client_cmd(id,"spk ^"access denied you slime bag^"")
               client_print(id,print_console, "You are not admin here, so
   you cant do that ... MMMM'kay ...")
               client_print(id,print_console,  "  or  maybe you forgot to
   sign in ... MMMM'kay ... The command:   amx_signin")
               return PLUGIN_HANDLED
           }else{
               //  We  allow  command to pass to next plugins if in guest
   mode.
               // Command is only executed it the guest admin has access
               AllowCommand = 0
               DenyAdmin = 0
               return PLUGIN_CONTINUE
           }
       }
       AllowCommand = 0
       DenyAdmin = 0
       client_cmd(id,"spk ^"access denied^"")
       for (i = 1; i <= iMaxPlayers; i++) {
           get_user_authid(i, Authid,39)
           get_user_name(i,Name,33)
                if(equal(Authid, HiAUTHID)){
               copy(HiName,33,Name)
           }
       }
       FoundHi = 0
       client_print(id,print_console,  "%s is the current top admin here,
   ask him.", HiName)
       return PLUGIN_HANDLED
   }
   public AdminHierarchy_2(id){
       new i
       new j
       new topon = 1000
       new comgive
       new iMaxPlayers = get_maxplayers() +1
       new cAuthid[39]
       new pAuthid[39]
       get_user_authid(id,cAuthid, 39)

       for (j = 1; j <= iMaxPlayers; j++) {
           get_user_authid(j,pAuthid,39)
           for (i = 1; i <= TotalAdmins; i++) {
               if((equal(pAuthid, AdminInfo[i])) && (i < topon)){
                   topon = i
               }
               if(equal(cAuthid, AdminInfo[i])){
                   comgive = i
               }
           }
       }
       if(topon < comgive){
           client_print(id,print_chat,  "Sorry, menu is restricted when a
   higher admin is here. Signed in or not.")
           client_cmd(id,"spk ^"access denied^"")
           return PLUGIN_HANDLED
       }
       return PLUGIN_CONTINUE
   }
   public CantBanMe(id){
       new i
       new authid[39]
       new DenyRequest
       new Name[33]
       new Command[33]
       new arg[33]
       new arg2[33]
       read_argv(0,Command,33)
       read_argv(1,arg,33)
       read_argv(2,arg2,33)
       if(containi(Command,"menu") != -1){
           client_print(id,print_chat,"[AMX]  Please use console commands
   not menus")
           console_print(id,"[AMX]   Please   use  console  commands  not
   menus")
           return PLUGIN_HANDLED
       }
       new player
       if(containi(Command,"ban") !=-1)
           player = cmd_target(id,arg2,0)
       else
           player = cmd_target(id,arg,0)
       get_user_name(player,Name,33)
       get_user_authid(player,authid,39)
       for (i = 1; i <= TotalAdmins; i++) {
           if(equal(authid, AdminInfo[i])){
               DenyRequest = 1
   #if AllowOwnerKick == 1
               if((contain(Command,  "kick")  !=  -1)  &&  (equal(authid,
   AdminInfo[1])) && (bCloakOwner == true)){
                   DenyRequest = 0
               }
   #endif
           }
       }
       if(DenyRequest == 1){
           client_print(id,print_console, "Sorry,  %s cannot be banned or
   kicked from here.", Name)
           client_cmd(id,"spk  ^"access  denied _comma administration has
   safe status^"")
           DenyRequest = 0
           return PLUGIN_HANDLED
       }
       return PLUGIN_CONTINUE
   }
   public admin_resign(id){
       if (!(get_user_flags(id)&ADMIN_VOTE)){
           client_print(id,print_console,"[AMX]  You  have  no  access to
   that command")
           return PLUGIN_HANDLED
       }
       new i
       new UserName[33]
       new AUTHID[39]
       new FoundHi
       new HiAUTHID[39]
       new HiName[33]
       new FoundHix
       new HiAUTHIDx[39]
       new HiNamex[33]
       new iMaxPlayers = get_maxplayers() +1
       new Name[33]
       new Authid[39]
       get_user_name(id,UserName,33)
       get_user_authid(id,AUTHID,39)
       for (i = 1; i <= TotalAdmins; i++) {
           if(AdminOn[i] == 1){
               if(FoundHix == 0){
                   copy(HiAUTHIDx,39,AdminInfo[i])
                   FoundHix =1
               }
           }
           if(equal(AUTHID, AdminInfo[i])){
               AdminOn[i] = 0
               AdminResign[i] = 1
           }
           if(AdminOn[i] == 1){
               if(FoundHi == 0){
                   copy(HiAUTHID,39,AdminInfo[i])
                   FoundHi =1
               }
           }
       }
       for (i = 1; i <= iMaxPlayers; i++) {
           get_user_authid(i, Authid,39)
           get_user_name(i,Name,33)
                if(equal(Authid, HiAUTHID)){
               copy(HiName,33,Name)
           }
               if(equal(Authid, HiAUTHIDx)){
               copy(HiNamex,33,Name)
           }
       }
       if(FoundHi==0){
           copy(HiName,33, "... uh, there is none.")
       }
       if(equal(UserName, HiNamex)){
           client_print(id,print_console,  "%s resigned. Top admin is now
   %s", UserName, HiName)
           if(bReportS == true){
               client_print(0,print_chat,  "%s resigned. Top admin is now
   %s", UserName, HiName)
           }else{
               client_print(id,print_console,   "This  was  not  publicly
   reported.")
           }
       }else{
           client_print(id,print_console,  "%s  resigned.  Top  admin was
   always %s", UserName, HiName)
           if(bReportS == true){
               client_print(0,print_chat,  "%s  resigned.  Top  admin was
   always %s", UserName, HiName)
           }else{
               client_print(id,print_console,   "This  was  not  publicly
   reported.")
           }
       }
       FoundHi = 0
       FoundHix = 0
       return PLUGIN_HANDLED
   }
   public admin_signin(id){
       if (!(get_user_flags(id)&ADMIN_VOTE)){
           client_print(id,print_console,"[AMX]  You  have  no  access to
   that command")
           return PLUGIN_HANDLED
       }
       if(file_exists("addons/amx/adminhierarchy.txt") == 0){
           client_print(id,print_chat,   "ERROR:   No  adminhierarchy.txt
   found in ..addons/amx   Please create one.")
           client_print(id,print_console,  "ERROR:  No adminhierarchy.txt
   found in ..addons/amx   Please create one.")
           return PLUGIN_HANDLED
       }
       new i
       new UserName[33]
       new AUTHID[39]
       new FoundHi
       new HiAUTHID[39]
       new HiName[33]
       new iMaxPlayers = get_maxplayers() +1
       new Name[33]
       new Authid[39]
       get_user_name(id,UserName,33)
       get_user_authid(id,AUTHID,39)
       for (i = 1; i <= TotalAdmins; i++) {
           if(equal(AUTHID, AdminInfo[i])){
               AdminOn[i] = 1
               AdminResign[i] = 0
               if((equal(AUTHID,   AdminInfo[1]))   &&   (bCloakOwner  ==
   true)){
                   client_print(id,print_console,  "<Private Message> You
   are no longer cloaked.")
                   client_print(id,print_console,  "<Private Message> You
   are no longer cloaked.")
                   AdminOn[1] = 1
                   bCloakOwner = false
               }
           }
           if(AdminOn[i] == 1){
               if(FoundHi == 0){
                   copy(HiAUTHID,39,AdminInfo[i])
                   FoundHi =1
               }
           }
       }
       for (i = 1; i <= iMaxPlayers; i++) {
           get_user_authid(i, Authid,39)
           get_user_name(i,Name,33)
                if(equal(Authid, HiAUTHID)){
               copy(HiName,33,Name)
           }
       }
       if(FoundHi==0){
           copy(HiName,33, "... uh, there is none.")
       }
       i=1
       FoundHi = 0
       if(bReportS == true){
           client_print(id,print_console, "%s signed in. The top admin is
   %s", UserName, HiName)
           client_print(0,print_chat,  "%s  signed  in.  The top admin is
   %s", UserName, HiName)
       }else{
           client_print(id,print_console, "%s signed in. The top admin is
   %s", UserName, HiName)
           client_print(id,print_console,    "This   was   not   publicly
   reported.")
       }
       return PLUGIN_HANDLED;
   }
   public admin_topadmin(id){
       if(file_exists("addons/amx/adminhierarchy.txt") == 0){
           client_print(id,print_chat,   "ERROR:   No  adminhierarchy.txt
   found in ..addons/amx   Please create one.")
           client_print(id,print_console,  "ERROR:  No adminhierarchy.txt
   found in ..addons/amx   Please create one.")
           return PLUGIN_HANDLED
       }
       new i
       new FoundHi
       new HiAUTHID[39]
       new HiName[33]
       new iMaxPlayers = get_maxplayers() +1
       new Name[33]
       new Authid[39]
       new cloak
       if(bCloakOwner == true){
           cloak = 2
       }else{
           cloak = 1
       }
       for (i = cloak; i <= TotalAdmins; i++) {
           if(AdminOn[i] == 1){
               if(FoundHi == 0){
                   copy(HiAUTHID,39,AdminInfo[i])
                   FoundHi =1
               }
           }
       }
       for (i = 1; i <= iMaxPlayers; i++) {
           get_user_authid(i, Authid,39)
           get_user_name(i,Name,33)
                if(equal(Authid, HiAUTHID)){
               copy(HiName,33,Name)
           }
       }
       if(FoundHi==0){
           copy(HiName,33, "... uh, there is none.")
       }
       i=1
       FoundHi = 0
       client_print(id,print_console,  "Current  top  admin:  %s    More:
   amx_adminstatus", HiName)
       client_print(0,print_chat,   "Current   top   admin:   %s    More:
   amx_adminstatus", HiName)
       return PLUGIN_HANDLED
   }
   public admin_adminstatus(id){
       if(file_exists("addons/amx/adminhierarchy.txt") == 0){
           client_print(id,print_console,  "ERROR:  No adminhierarchy.txt
   found in ..addons/amx   Please create one.")
           return PLUGIN_HANDLED
       }
       new i
       new j
       new FoundHi
       new HiAUTHID[39]
       new HiName[33]
       new iMaxPlayers = get_maxplayers() +1
       new Name[33]
       new Authid[39]
       new AdminCurName[33]
       new SignedIn[4]
       new PowStat[10]
       new SomeoneHere = 0
       new cloak
       if(bCloakOwner == true){
           cloak = 2
       }else{
           cloak = 1
       }
       FoundHi = 0
       client_print(id,print_console, " ^nRank / Signed In / Full Power /
   Constant Name / Current Name      %d ADMINS", TotalAdmins)
       for (i = cloak; i <= TotalAdmins; i++) {
           for (j = 1; j <= iMaxPlayers; j++) {
               if(is_user_connected(j) !=0){
               get_user_authid(j, Authid,39)
               if(equal(Authid, AdminInfo[i])){
                   if (get_user_flags(id)&ADMIN_VOTE){
                       if(  (equal(AdminType[i],"1"))  &&  (AdminOn[i] ==
   1)){
                           copy(PowStat, 10,"-Enabled-")
                           FoundHi = 1
                       }else{
                           if((AdminOn[i] == 1) && (FoundHi == 0)){
                               copy(PowStat, 10,"-Enabled-")
                               FoundHi = 1
                           }else{
                               copy(PowStat, 10, "Resticted")
                           }
                       }
                       SomeoneHere = 1
                       if(AdminOn[i] == 1){
                           copy(SignedIn,4, "Yes")
                       }else{
                           copy(SignedIn,4, "No ")
                       }
                       get_user_name(j,AdminCurName,33)
                       if(i < 10){
                           client_print(id,print_console,
   "0%d     %s       %s    %s        %s",     i,    SignedIn,    PowStat,
   AdminName[i], AdminCurName)
                       }else{
                           client_print(id,print_console,
   "%d     %s       %s    %s        %s",     i,     SignedIn,    PowStat,
   AdminName[i], AdminCurName)
                       }
                   }else{
                       if (get_user_flags(j)&ADMIN_VOTE){
                           if(  (equal(AdminType[i],"1"))  && (AdminOn[i]
   == 1)){
                               copy(PowStat,10, "-Enabled-")
                               FoundHi = 1
                           }else{
                               if((AdminOn[i] == 1) && (FoundHi == 0)){
                                   copy(PowStat, 10, "-Enabled-")
                                   FoundHi = 1
                               }else{
                                   copy(PowStat,10, "Resticted")
                               }
                           }
                           SomeoneHere = 1
                           if(AdminOn[i] == 1){
                               copy(SignedIn,4, "Yes")
                           }else{
                               copy(SignedIn,4, "No ")
                           }
                           get_user_name(j,AdminCurName,33)
                           if(i < 10){
                               client_print(id,print_console,
   "0%d     %s       %s    %s        %s",     i,    SignedIn,    PowStat,
   AdminName[i], AdminCurName)
                           }else{
                               client_print(id,print_console,
   "%d     %s       %s    %s        %s",     i,     SignedIn,    PowStat,
   AdminName[i], AdminCurName)
                           }
                       }
                   }
               }
               }
           }
       }
       FoundHi = 0
       if(SomeoneHere==0){
           client_print(id,print_console,  "Hmmm.... I guess there are no
   admins on. Whether they are signed in or not.")
       }else{
           for (i = 1; i <= TotalAdmins; i++) {
               if(AdminOn[i] == 1){
                   if(FoundHi == 0){
                       copy(HiAUTHID,39,AdminInfo[i])
                       FoundHi =1
                   }
               }
           }
           for (i = 1; i <= iMaxPlayers; i++) {
               get_user_authid(i, Authid,39)
               get_user_name(i,Name,33)
                    if(equal(Authid, HiAUTHID)){
                   copy(HiName,33,Name)
               }
           }
           if(FoundHi==0){
               copy(HiName,33, "... uh, none. Nobody signed in.")
           }
           i=1
           FoundHi = 0
           client_print(id,print_console,  "The current top admin is %s",
   HiName)
       }
       client_print(id,print_console, " ")
       SomeoneHere = 0
       return PLUGIN_HANDLED
   }
   public admin_signin_deflt(id){
       if (!(get_user_flags(id)&ADMIN_RCON)){
           client_print(id,print_console,"[AMX]  You  have  no  access to
   that command")
           return PLUGIN_HANDLED
       }
       if(bAutoSignIn == true){
           bAutoSignIn = false
           ejl_vault("WRITE","EJL_ADMINH_MODE","manual")
           client_print(id,print_console,    "Admins    are   no   longer
   automaically signed in.  This has been set as the default.")
       }else{
           bAutoSignIn = true
           ejl_vault("WRITE","EJL_ADMINH_MODE","auto")
           client_print(id,print_console,   "Admins  will  be  signed  in
   automatically.  This has been set as the default.")
       }
       return PLUGIN_HANDLED
   }
   public admin_ah_report(id){
       if (!(get_user_flags(id)&ADMIN_RCON)){
           client_print(id,print_console,"[AMX]  You  have  no  access to
   that command")
           return PLUGIN_HANDLED
       }
       if(bReportS == true){
           bReportS = false
           ejl_vault("WRITE","EJL_ADMINH_REPORT","off")
           client_print(id,print_console,  "Admins'  sign in and sign out
   are no longer reported in chat -- now set as default.")
       }else{
           bReportS = true
           ejl_vault("WRITE","EJL_ADMINH_REPORT","on")
           client_print(id,print_console,  "Admins'  sign in and sign out
   are now reported in chat -- now set as default.")
       }
       return PLUGIN_HANDLED
   }
   public admin_ah_guest(id){
       if (!(get_user_flags(id)&ADMIN_RCON)){
           client_print(id,print_console,"[AMX]  You  have  no  access to
   that command")
           return PLUGIN_HANDLED
       }
       if(bGuest == true){
           bGuest = false
           client_print(id,print_console, "[AMX] Adminhierachy guest mode
   is now OFF")
       }else{
           bGuest = true
           client_print(id,print_console, "[AMX] Adminhierachy guest mode
   is now ON")
       }
       return PLUGIN_HANDLED
   }
   public admin_cloak_own(id){
       if (!(get_user_flags(id)&ADMIN_LEVEL_B)){
           client_print(id,print_console,"[AMX]  You  have  no  access to
   that command")
           return PLUGIN_HANDLED
       }
       new AUTHID[39]
       get_user_authid(id, AUTHID,39)
       if(equal(AdminInfo[1], AUTHID)){
           if(bCloakOwner == true){
               bCloakOwner = false
               ejl_vault("WRITE","EJL_ADMINH_CLOAK","off")
               client_print(id,print_console,   "You   are   NOT  cloaked
   now.   This has been set as the default.")
           }else{
               bCloakOwner = true
               AdminOn[1] = 0
               ejl_vault("WRITE","EJL_ADMINH_CLOAK","on")
               client_print(id,print_console, "You are now CLOAKED.  This
   has been set as the default.")
           }
       }else{
           client_print(id,print_console, "You do not have access to this
   command because you are not listed as the 1st admin.")
       }
       return PLUGIN_HANDLED
   }
   public admin_ah_reload(id){
       if (!(get_user_flags(id)&ADMIN_RCON)){
           client_print(id,print_console,"[AMX]  You  have  no  access to
   that command")
           return PLUGIN_HANDLED
       }
       TotalAdmins = 0
       if(file_exists("addons/amx/adminhierarchy.txt") == 1){
           new line = 0
           new data[128]
           new stextsize = 0
           while((line=read_file("addons/amx/adminhierarchy.txt",line,dat
   a,128,stextsize))!=0){
               if(    (equal(data,"1",1))   ||   (equal(data,"2",1))   ||
   (equali(data,"a",1))         ||         (equali(data,"b",1))        ||
   (equali(data,"c",1))  ){
                   TotalAdmins += 1
                   if(TotalAdmins < 100){
                            parse(data,     AdminType[TotalAdmins],    2,
   AdminInfo[TotalAdmins], 39, AdminName[TotalAdmins], 33)
                   }
               }
           }
       }
       client_print(id,print_console, "Reloaded: Adminhierachy.txt.   Any
   changes made are now in effect.")
       return PLUGIN_HANDLED
   }
   public ejl_vault(rw[],key[],value[]){
       new data[192]
       new stxtsize = 0
       new line = 0
       new skip = 0
       new vkey[64]
       new vvalue[128]
       new vaultwrite[192]
       if(equal(rw,"READ")){
           if(file_exists("addons/amx/ejl_vault.ini") == 1){
               copy(vault_value,128,"")
               while((line=read_file("addons/amx/ejl_vault.ini",line,data
   ,192,stxtsize))!=0){
                   parse(data,vkey,64,vvalue,128)
                   if(equal(vkey,key)){
                       copy(vault_value,128,vvalue)
                   }
               }
           }else{
               write_file("addons/amx/ejl_vault.ini",  "****  Plugins use
   to store values -- immune to crashes and map changes ****", 0)
           }
       }
       else if(equal(rw,"WRITE")){
           if(file_exists("addons/amx/ejl_vault.ini") == 1){
               format(vaultwrite,192,"%s %s",key,value)
               while((line=read_file("addons/amx/ejl_vault.ini",line,data
   ,192,stxtsize))!=0){
                   parse(data,vkey,64,vvalue,128)
                   if(skip == 0){
                       if( (equal(data,"")) || (equal(vkey,key)) ){
                           skip = 1
                           write_file("addons/amx/ejl_vault.ini",vaultwri
   te,line-1)
                       }
                   }
                   else if(equal(vkey,key)){
                       write_file("addons/amx/ejl_vault.ini","",line-1)
                   }
               }
               if(skip == 0){
                   write_file("addons/amx/ejl_vault.ini",vaultwrite,-1)
               }
           }
       }
       return PLUGIN_CONTINUE
   }
