#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Admine Show Motd"
#define VERSION "1.0"
#define AUTHOR "xXxAdyxXx;x"
#define CharsMax(%3) sizeof %3 - 3
#define MAX_GROUPS 7
new g_groupNames[MAX_GROUPS][] = {
"=--=[] FonDaToR []=--=",
"=--=[] OwNeR []=--=",
"=--=[] Co-OwNeR []=--=",
"=--=[] GodS []=--=",
"=--=[] SeMi-GodS []=--=",
"=--=[] MoDeRaToR []=--=",
"=--=[] AdMiNiStRaToR []=--=",
"=--=[] HeLpeR []=--=",
"=--=[] TeSteR []=--=",
"=--=[] V.I.P []=--=",
"=--=[] SloT []=--="
}
new g_groupFlags[MAX_GROUPS][] = {
"abcdefghijklmnopqrstu",
"abcdefghijkmnopqrstu",
"abcdefgijkmnopqrstu",
"bcdefgijkmnopqrs",
"bcdefgijkmnopqr",
"bcdefgijmnopq",
"bcdefgijmno",
"bcdefgijmn",
"bcefgijm",
"bit",
"b"
}
new g_groupFlagsValue[MAX_GROUPS];
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
for(new i = 0; i < MAX_GROUPS; i++)
g_groupFlagsValue = read_flags(g_groupFlags);
register_clcmd("say /admin", "cmdWho", -1, "");
register_clcmd("say /who", "cmdWho", -1, "");
register_clcmd("say /admins", "cmdWho", -1, "");
register_clcmd("say /whos", "cmdWho", -1, "");
}
public cmdWho(id)
{
static sPlayers[32], iNum, iPlayer;
static sName[32], sBuffer[1024];
static iLen;
iLen = formatex(sBuffer, sizeof sBuffer - 1, "<body bgcolor=#000000><font color=#7b68ee><pre>");
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen,"<center><h2>Admini online [Furien.OnlyOns.Ro]<font color=^"red^"><B></B></font></h2></center>^n^n");
get_players(sPlayers, iNum, "ch");
for(new i = 0; i < MAX_GROUPS; i++)
{
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen, "<center><h5><font color=^"yellow^"><B>%s</B>^n</font></h5></center>", g_groupNames);
for(new x = 0; x < iNum; x++)
{
iPlayer = sPlayers[x];
if(get_user_flags(iPlayer) == g_groupFlagsValue)
{
get_user_name(iPlayer, sName, sizeof sName - 1);
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen, "<center>%s^n</center>", sName);
}
}
}
show_motd(id, sBuffer, "Adminii Serverului");
return 0;
}