Well.. i show you the code:
PHP Code:
#include <amxmodx>
#define ADMIN_CHECK ADMIN_KICK
new maxplayers
public plugin_init()
{
register_plugin("Admin Check edited", "1.0", "OneEyed && Alucard")
maxplayers = get_maxplayers()
register_clcmd("say", "handle_say")
}
public handle_say(id)
{
new said[192]
read_args(said,192)
if( ( containi(said, "quien") != -1 && containi(said, "admin") != -1 ) || contain(said, "/admin") != -1 )
{
new adminnames[33][32]
new Name[32]
new i, count, x
get_user_name(id, Name, 31)
for(i = 1 ; i <= maxplayers ; i++)
{
if(is_user_connected(i) )
{
if(get_user_flags(i) & ADMIN_CHECK)
get_user_name(i, adminnames[count++], 31)
}
}
if(count > 0)
{
for(x = 0 ; x < count ; x++)
{
server_cmd("amx_msg %s ^"Admins Online:\n%s%s^"", Name, adminnames[x], x < (count-1) ? "\n":"")
server_exec()
}
}
if(count < 0)
{
server_cmd("amx_msg %s ^"No admins online^"", Name)
server_exec()
}
}
else
return PLUGIN_CONTINUE
return PLUGIN_HANDLED
}
I tested in lan and in a dedicated server. When i have the name with the Admin... and i use /admins command... show me
"Admins Online:
Alucard^"
Good... but when i use a name without the admin... and /admins command... would show me "No admins online". But no... the msg doesn't appear. Is something of flags, or what?
Thx and sry for my english.
__________________