PHP Code:
#include <amxmodx>
/*---------------EDIT ME------------------*/
#define ADMIN_CHECK ADMIN_BAN
#define GOLDEN_CHECK ADMIN_LEVEL_H
#define SILVER_CHECK ADMIN_LEVEL_G
static const COLOR[] = "^x04"; //green
static const CONTACT[] = "";
/*----------------------------------------*/
new maxplayers;
new gmsgSayText;
new amx_contactinfo;
public plugin_init() {
register_plugin("Admin Check", "1.51", "OneEyed");
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, GOLDEN_CHECK, SILVER_CHECK};
static const admin_names[][] = {"Admins", "Golden Players", "Silver Players"};
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 %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 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();
}
can some one edit this plugin
and make it with three color
for example
if i type
/all
the silver player written on silver color
the golden player written on yellow color
the admin player wrriten on green color
its just 1 color now (green) only
and looking to make it with three color
thanks all
__________________