Getting a list of ALL admins, including non-present ones
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:
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. |
Re: Getting a list of ALL admins, including non-present ones
Quote:
|
Re: Getting a list of ALL admins, including non-present ones
When exactly are you attempting to use that code. I just tested it (calling at plugin_init) and it is returning admins for me...or perhaps I am not understanding your objective/question. I don't use SQL or anything for admins, just users.ini.
PHP Code:
Code:
VALVE_ID_LOOPBACK;loopback;STEAM_0:0:XXXXX |
Re: Getting a list of ALL admins, including non-present ones
It's probably because I'm using SQL tables, perhaps there is a delay before the core plug-in has finished loading the admins from it.
Perhaps I should attempt to call it again after 15 seconds if it doesn't find any admins the first time round. |
Re: Getting a list of ALL admins, including non-present ones
When exactly are you trying to execute the code?
|
Re: Getting a list of ALL admins, including non-present ones
plugin_init() calls ReadAdmins().
I've fixed this by trying again 5 seconds later after a fail, though it sets a global bool to true so it only tries again once. |
Re: Getting a list of ALL admins, including non-present ones
Quote:
|
Re: Getting a list of ALL admins, including non-present ones
Does plugin_cfg() run after admins have been loaded? (even from SQL)
|
Re: Getting a list of ALL admins, including non-present ones
I have no idea if it makes any difference for what you're doing but it never hurts to try.
|
Re: Getting a list of ALL admins, including non-present ones
Looks to me like it loads at the same time that it would if it wasn't SQL.
|
| All times are GMT -4. The time now is 07:10. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.