Hi,
I'm trying to retrieve a list of all administrators stored in AMXX's dynamic list. I see that in amxmodx.inc there is a function admins_lookup() to do this, but perhaps I'm using it wrong:
PHP Code:
static iAdmins;
static fFlags;
static szAuthData[44];
new szAdmins[MAX_ADMINS_LENGTH]
format(szAdmins, MAX_ADMINS_LENGTH, "VALVE_ID_LOOPBACK")
iAdmins = admins_num();
for (new i = 0; i < iAdmins; i++)
{
fFlags = admins_lookup(i, AdminProp_Flags);
admins_lookup(i, AdminProp_Auth, szAuthData, sizeof(szAuthData) - 1);
if (fFlags & FLAG_AUTHID || fFlags & FLAG_IP)
format(szAdmins, MAX_ADMINS_LENGTH, "%s;%s", szAdmins, szAuthData)
}
Basically I'm trying to get all administrators into a string, split by a semi-colon. It should not matter if the administrators are stored in a file or SQL table as I want to read them after they are loaded by the core.
The main issue I'm finding is iAdmins is always 0 -- so the admin_num() function isn't returning anything, or is being called after the core plug-in has loaded the list of administrators.
__________________