PHP Code:
#include <amxmodx>
/*---------------EDIT ME------------------*/
#define ADMIN_CHECK ADMIN_BAN
#define CLASSIC_CHECK ADMIN_VOTE
#define VIP_CHECK ADMIN_CFG
static const COLOR[] = "^x04"; //green
static const CONTACT[] = "";
/*----------------------------------------*/
new maxplayers;
new gmsgSayText;
new amx_contactinfo;
public plugin_init() {
register_plugin("Final admin check", "2.0", "SAMI");
gmsgSayText = get_user_msgid("SayText");
register_clcmd("say /all", "print_list");
amx_contactinfo = register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER);
}
public print_list(user) {
set_task(0.1, "task_print_list", user);
}
public task_print_list(user) {
new players[32], pnum;
get_players(players, pnum);
new player;
new flags[32];
static names[32][32];
for(new i = 0; i < pnum; i++) {
player = players[i];
flags[i] = get_user_flags(player);
get_user_name(player, names[i], charsmax(names[]));
}
static const admin_flags[] = {ADMIN_CHECK, CLASSIC_CHECK, VIP_CHECK};
static const admin_names[][] = {"Admins", "Classic Admins", "VIP"};
static message[256];
new len;
new admin_flag;
new admins[32];
new count;
for(new i = 0, j; i < sizeof(admin_flags); i++) {
len = formatex(message, charsmax(message), "%s [AMXX] %s Online: ", COLOR, admin_names[i]);
admin_flag = admin_flags[i];
count = 0;
for(j = 0; j < pnum; j++) {
if(flags[j] & admin_flag) {
admins[count++] = j;
}
}
if(count > 0) {
for(j = 0; j < count; j++) {
len += formatex(message[len], charsmax(message) - len, "%s%s", names[admins[j]], (j < (count - 1)) ? ", " : "");
if(len > 96 && (j < (count - 1))) {
print_message(user, message);
len = formatex(message, charsmax(message), "%s ", COLOR);
}
}
} else {
len += formatex(message[len], charsmax(message) - len, " No %s are Online.", admin_names[i]);
}
print_message(user, message);
}
static contact[64];
get_pcvar_string(amx_contactinfo, contact, charsmax(contact));
if(contact[0]) {
static contactinfo[256];
formatex(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact);
print_message(user, contactinfo);
}
}
print_message(id, msg[]) {
message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id);
write_byte(id);
write_string(msg);
message_end();
}
Tell me if something is wrong ;)
Almost forgot, Please edit the access flags.. i didnt get the ADMIN_LEVEL_N :S sorry
I know this :- n - User defined Level B