Raised This Month: $ Target: $400
 0% 

Getting a list of ALL admins, including non-present ones


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
AdamR
Senior Member
Join Date: Dec 2006
Location: Cardiff, South Wales
Old 07-08-2010 , 15:06   Getting a list of ALL admins, including non-present ones
Reply With Quote #1

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(szAdminsMAX_ADMINS_LENGTH"VALVE_ID_LOOPBACK")

iAdmins admins_num();

for (new 
0iAdminsi++)
{
    
fFlags admins_lookup(iAdminProp_Flags);
    
admins_lookup(iAdminProp_AuthszAuthDatasizeof(szAuthData) - 1);

    if (
fFlags FLAG_AUTHID || fFlags FLAG_IP)
        
format(szAdminsMAX_ADMINS_LENGTH"%s;%s"szAdminsszAuthData)

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.
__________________
Thanks,

Adam Reece - Sven Co-op team.
AdamR is offline
Send a message via Skype™ to AdamR
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode