Access Control Library 1.0.0 (olds.ro)
======================================
A shared library: other plugins ask one place whether a player has a named
admin right, what rank they have, and whether an admin may act on another
player, instead of each plugin reading flags on its own. Change the mapping
in one file and every plugin that uses the library follows.
Requirements
- AMX Mod X 1.10.0.5490 or newer
Install
1. Compile scripting/olds_acl.sma and copy olds_acl.amxx to
addons/amxmodx/plugins/. List it in plugins.ini before the plugins that
use it.
2. Copy configs/olds_acl.ini to addons/amxmodx/configs/.
3. For plugin authors: copy scripting/include/olds_acl.inc to
addons/amxmodx/scripting/include/ and #include <olds_acl>.
configs/olds_acl.ini
kick = c a right: granted by ANY of the letters
level 20 = cd a rank: players holding ALL of the letters have at
least this level (the highest matching line counts)
With no level lines, a player's level is the number of admin flags a-u
they hold. Without the file the standard rights are used (immunity = a,
reservation = b, kick = c, ban = d, slay = e, map = f, cvar = g, cfg = h,
chat = i, vote = j, password = k, rcon = l).
Natives (library "olds_acl", see include/olds_acl.inc)
acl_has_access(id, const right[]) right names are not case sensitive;
an unknown name returns false and
logs one warning (per name, per load)
acl_get_level(id) the player's rank
acl_can_target(admin, target) false when target holds an immunity
flag and admin does not outrank them;
yourself and the server console (0)
are always allowed
forward acl_changed(id) flags were read again: 0.1 s after
client_authorized / client_putinserver
(so admin.amxx has set them) when they
changed, and for everyone after
amx_acl_reload
A player index that is not connected raises a native error naming it.
Settings (addons/amxmodx/configs/plugins/olds_acl.cfg, created on first run)
olds_acl_default_immunity "a" flag letters that give immunity ("" = none)
Commands (ADMIN_CFG)
amx_acl_reload read olds_acl.ini again, no map change needed
amx_acl_status rights, levels, and each player's flags and level
No downloads: the library has no client-side output.