Код:
#include <amxmodx>
#include <amxmisc>
public plugin_init()
{
register_plugin("Admin_Check", "0.1", "p1Mp / S1n[L]Ss / CepeH9")
register_clcmd("say /admin", "show_admins")
register_clcmd("say /admins", "show_admins")
register_clcmd("say /vip", "show_admins")
register_clcmd("say /vips", "show_admins")
register_clcmd("say_team /admin", "show_admins")
register_clcmd("say_team /admins", "show_admins")
register_clcmd("say_team /vip", "show_admins")
register_clcmd("say_team /vips", "show_admins")
register_cvar("amx_contactinfo", "FCVAR_SERVER")
}
public show_admins(id)
{
new Admins[16], aCounter = 0
new VIP[16], vCounter = 0
new Info[16], iCounter = 0
new MaxP[32], pCounter, player
get_players(MaxP, pCounter, "ch")
for (new i=0 ; i<pCounter ; i++)
{
player = MaxP[i]
if (access(player, ADMIN_LEVEL_C)) {
Admins[aCounter] = player
aCounter++
continue;
}
if (access(player, ADMIN_KICK)) {
VIP[vCounter] = player
vCounter++
continue;
}
if (access(player, ADMIN_KICK)) {
Info[iCounter] = player
iCounter++
continue;
}
}
if (aCounter == 0) // Admins online
{
ChatColor(id, "!t[!gСервер!t] !gАдминистраторы на сервер: !tНету админов на сервере пользуйся VOTEBAN")
}
else
{
new adminonline[200]
new adminname[32], iAdminID
for (new z=0 ; z<aCounter ; z++)
{
iAdminID = Admins[z]
get_user_name(iAdminID, adminname, 31)
add(adminonline, charsmax(adminonline), adminname)
if (z != aCounter-1)
{
add(adminonline, charsmax(adminonline), ", ")
}
}
ChatColor(id, "!t[!gСервер!t] !gАдминистраторы на сервер: !t%s.", adminonline)
}
if (vCounter == 0) // VIP online
{
ChatColor(id, "!t[!gСервер!t] !gВипов: !tв сети нет.")
}
else
{
new viponline[200]
new vipname[32], iVIPID
for (new z=0 ; z<vCounter ; z++)
{
iVIPID = VIP[z]
get_user_name(iVIPID, vipname, 31)
add(viponline, charsmax(viponline), vipname)
if (z != vCounter-1)
{
add(viponline, charsmax(viponline), ", ")
}
}
ChatColor(id, "!t[!gСервер!t] !gВипов: !t%s.", viponline)
}
if (iCounter == 0) // Контактная информация
{
new contact[112]
get_cvar_string("amx_contactinfo", contact, 63)
if(contact[0])
{
ChatColor(id, "!t[!gСервер!t] !gКонтактная информация, для связь c Админом. !y[Skype: zlou_kotik | Vk.Com/zlou_kotuk]!t%s", contact)
}
}
else
{
new kinfo[200]
new kname[32], iInfoID
for (new z=0 ; z<iCounter ; z++)
{
iInfoID = Info[z]
get_user_name(iInfoID, kname, 31)
add(kinfo, charsmax(kinfo), kname)
if (z != iCounter-1)
{
add(kinfo, charsmax(kinfo), ", ")
}
}
}
}
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!t", "^3")
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}