Hello, i would like your help in modifying a plugin similar to the amx_who command. This is the plugin's .sma :
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define ACCESS ADMIN_ADMIN
#define MAX_GROUPS 9
new g_groupNames[MAX_GROUPS][] = {
"-=[Owner]=-",
"-=[Co-Owner]=-",
"-=[God]=-",
"-=[Super Moderator]=-",
"-=[Moderator]=- ",
"-=[Administrator]=- ",
"-=[Semi Administrator]=-",
"-=[Helper]=-",
"-=[Slot]=-"
}
new g_groupFlags[MAX_GROUPS][] = {
"abcdefghijklmnopqrstu",
"bcdefghijklmnopqrst",
"bcdefghijlmnopqrst",
"bcdefghijlmnopqrs",
"bcdefgijlmnopqr",
"bcdefgijmnop",
"bcdefgijmn",
"bcefijmn",
"b"
}
new g_groupFlagsValue[MAX_GROUPS]
public plugin_init()
{
register_plugin("Admin_Who", "1.0", "SileNNNT")
register_concmd("admin_who", "cmdWho",ACCESS)
for(new i = 0; i < MAX_GROUPS; i++)
{
g_groupFlagsValue[i] = read_flags(g_groupFlags[i])
}
}
public cmdWho(id)
{
new players[32], inum, player, name[32], i, a
get_players(players, inum)
console_print(id, "[ Admini Online ]")
for(i = 0; i < MAX_GROUPS; i++)
{
console_print(id, "-----[%d]%s-----", i+1, g_groupNames[i])
for(a = 0; a < inum; ++a)
{
player = players[a]
get_user_name(player, name, 31)
if(get_user_flags(player) == g_groupFlagsValue[i])
{
console_print(id, "%s", name)
}
}
}
console_print(id, "[ Admini Online ]")
return PLUGIN_HANDLED
}
The problem is that the command admin_who is usable to all classes of flags instead of ADMIN_ADMIN. this is what i want : to make the command admin_who only usable by admins. I know that amx_who does that very thing, but it shows the accesses chaotic somehow. this way it would be clear what's the rank of every admin.
I also tried to modify cmdaccess.ini as follows :
Code:
"admin_who" "y" ; admin_who.amxx
with no effect whatsoever on the command.
Thank You in advance for your help!
P.S. i have searched prior to my posting for a solution but i haven't found one.