Thread: Admin Hierarchy
View Single Post
Plugin Info:     Modification:          Category:          Approver:   danielkza (6)
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-06-2009 , 11:02   Admin Hierarchy
Reply With Quote #1

Admin Hierarchy v0.2

- Description -
This plugin will allow only one 'power-level' of admins to have their admin power on the server at one time. The admin(s) on the server with the highest level of admin power will reign over lower-power admins. If a higher power-level admin is on the server, any admins with lower\less admin powers will lose their admin power until all higher-level admins disconnect. If an admin connects that has admin flags equal to the current highest level, he will keep his admin power. When the lower-level admins powers get suspended, their flags get set to the flags defined in cvar ah_user. If you choose to allow your lower-power admins to retain particular powers when their power is suspended, set the appropriate flags in ah_user cvar. Once all higher-level admins disconnect, power is restored to the next lower power-level admin(s). There are 2 modes that can be used, see explanation below.

- Required Modules -
  • *None*
- CVars -
  • Main
    • ah_mode - Mode, see below for description - default: 0
    • ah_user - When a players admin powers are suspended, they are set to these flags - default: z

  • Admin Levels (Mode 1 only)
    • ah_owner - Flags for owner power level (highest) - default: abcdefghijklmnopqrstu
    • ah_administrator - Flags for administrator power level - default: bcdefijmnopqrstu
    • ah_moderator - Flags for moderator power level - default: bcdefiju
    • ah_chief - Flags for chief power level - default: bcefij
    • ah_officer - Flags for officer power level (lowest) - default: b

- Modes -
  • Mode 0 - Admin level is based on the number of admin flags (quantity) that the player has. ie "abcd" = 4, "abcdef" = 6. Players with the higher number of flags will reign over admins with less flags. If a 6-flag admin joins the server and a 4-flag admin is present on the server, the 4-flag admins admin powers will be suspended until the 6-flag admin disconnects. This mode is a bit more flexible because you can use any combination of flags and all admins will be affected by the plugin.
  • Mode 1 - This mode functions identically to mode 0 except it uses pre-defined admin levels. For admins that you want to be affected by the plugin, you must have their admin flags in users.ini EXACTLY as defined in the admin level cvar for the power level you want the admin to have. There are 5 levels of admin power to choose from, owner being the highest power and officer being lowest. You do not need to use all admin levels. This mode is a bit more 'restrictive' than mode 1 because the admin flags in users.ini must be EXACTLY as they are in one of the cvar levels or else the plugin will not recognize them.
- Example Configurations - In each case, the level of power will be 11111 (highest), 22222, 33333 (lowest)
  • Mode 0 - Admin level cvars are not used
    • users.ini
      "STEAM_0:0:11111" "" "abcdefghijklmnopqrstu" "ce"
      "STEAM_0:0:22222" "" "abcdefghi" "ce"
      "STEAM_0:03333" "" "bcdefghi" "ce"
  • Mode 1 - Admin level cvars must match admin flags set in users.ini
    • users.ini
      "STEAM_0:0:11111" "" "abcdefghijklmnopqrstu" "ce"
      "STEAM_0:0:22222" "" "bcdefijmnopqrstu" "ce"
      "STEAM_0:03333" "" "bcdefiju" "ce"
    • cvars
      ah_owner "abcdefghijklmnopqrstu"
      ah_administrator "bcdefijmnopqrstu"
      ah_moderator "bcdefiju"
- Note -
I am aware that there is a similar plugin ported by kingpin back in 04 (http://forums.alliedmods.net/showthread.php?t=1829) but the functionality of this plugin is different. This was made by request to function as it does. I posted here for others who are looking for similar functionality.

- Change Log -
  • v0.2
    - Added notification to high power admins advising that they currently have power on the server and all lower admins have lost power.
    - Added '/admin' & '/admins' chat command that will display online admins. If there are admins whose power was suspended, it will display both Active and Suspended admins, and sv_contact email. If using amx super or another plugin that uses the /admins command, place this plugin before it in plugins.ini.
    - Changed ah_slot to ah_officer and changed ah_officer to ah_chief.
    - Fixed bug where ah_slot (now ah_officer) power level was not being recognized when using mode 1.
Attached Files
File Type: sma Get Plugin or Get Source (adminhierarchy.sma - 3472 views - 16.6 KB)
__________________

Last edited by Bugsy; 07-19-2009 at 10:17. Reason: Typo correction
Bugsy is offline