Raised This Month: $ Target: $400
 0% 

[help script] show my name in 2 access


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 07-12-2016 , 16:37   Re: [help script] show my name in 2 access
Reply With Quote #9

Quote:
Originally Posted by siriusmd99 View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define VIP_FLAG ADMIN_KICK

new const TAG[] = "[amxx]"
new const SERVERNAME[] = "amxx"
new const MESSAGE[] = "No online:"

new const rank_names[][] =
{
    
"Administrator",
    
"Moderator",
    
"VIP"
}

new const 
rank_flags[][] =
{
    
"abcdefghijklmnopqrstu",
    
"bcdefghijklmnopqr",
    
"cehij"
}

new 
vip_rank sizeof rank_names 1;
new 
flags_rank[sizeof rank_flags], g_maxplayersg_msg_saytext;

public 
plugin_init()
{
    
register_plugin("New Who Menu""1.1""GoogleStrik");
    
    
register_clcmd("say /admins""cmd_who");
    
register_clcmd("say /admin""cmd_who");
    
    
g_maxplayers get_maxplayers();
    
g_msg_saytext get_user_msgid("SayText");
    
    for(new 
0sizeof rank_flagsi++)
        
flags_rank[i] = read_flags(rank_flags[i]);
}

public 
cmd_who(id)
{
    new 
menumenu_item[80], tasta[2];
    
formatex(menu_itemcharsmax(menu_item), "\r[%s] \dAdmin List Online"SERVERNAME);
    
menu menu_create(menu_item"handler_who");
    for(new 
0sizeof rank_namesi++)
    {
        
formatex(menu_itemcharsmax(menu_item), "\y%s\r[\w%d\r]"rank_names[i], get_rang_players(i));
        
tasta[0] = i;
        
tasta[1] = 0;
        
menu_additem(menumenu_itemtasta);
    }
    
menu_display(idmenu0);
    return 
PLUGIN_HANDLED;
}

public 
handler_who(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    
menu_destroy(menu);
    
show_players_rang(iditem);
    return 
PLUGIN_HANDLED;
}

public 
show_players_rang(iditem)
{
    if(!
get_rang_players(item))
    {
        
color(id".v%s.g %s.e %s.g!"TAGMESSAGErank_names[item]);
        return 
PLUGIN_HANDLED;
    }
    new 
menu_item[80], tasta[2], menu;
    
formatex(menu_itemcharsmax(menu_item), "\rAdmin List Level\y %s\r.^nMany Member Online:\y %d^n"rank_names[item], get_rang_players(item))
    
menu menu_create(menu_item"handler_players_rang");
    new 
ixul;
    
xul 0;

    if(
item == vip_rank)
    {
        for(
1<= g_maxplayersi++)
        {
            if(!
is_user_connected(i))
                continue;
                
            if(
get_user_flags(i) & VIP_FLAG)
            {
                
formatex(menu_itemcharsmax(menu_item), "\y%s"get_name(i));
                
tasta[0] = xul;
                
tasta[1] = 0;
                
xul++;
                
menu_additem(menumenu_itemtasta);
            }
        }
    }
    else
    {
        for(
1<= g_maxplayersi++)
        {
            if(!
is_user_connected(i))
                continue;
                
            if(
get_user_flags(i) == flags_rank[item] || get_user_flags(i) == (flags_rank[item] | VIP_FLAG))
            {
                
formatex(menu_itemcharsmax(menu_item), "\y%s"get_name(i));
                
tasta[0] = xul;
                
tasta[1] = 0;
                
xul++;
                
menu_additem(menumenu_itemtasta);
            }
        }    
    }
    
    
menu_display(idmenu0);
    return 
PLUGIN_HANDLED;
}

public 
handler_players_rang(idmenu)
{
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}
    
public 
get_rang_players(rank)
{
    new 
iplayers;
    
    if(
rank == vip_rank)
    {
        new 
tmp;
        for(
1<= g_maxplayersi++)
        {
            
tmp get_user_flags(i);
            if(
is_user_connected(i) && (tmp VIP_FLAG) && !(tmp ADMIN_BAN))    
               
players++;
        }
    }
    else
    {
        for(
1<= g_maxplayersi++)
        {
            if(
is_user_connected(i) && get_user_flags(i) == flags_rank[rank] || get_user_flags(i) == (flags_rank[rank] | VIP_FLAG))
                
players++;
        }
    }
    return 
players;
}

stock get_name(id)
{
    new 
name[32];
    
get_user_name(idnamecharsmax(name));
    return 
name;
}

stock color(const id, const input[], any:...)
{
    new 
count 1players[32];
    new 
msg[191];
    
vformat(msg190input3);
    
    
replace_all(msg190".v""^4");
    
replace_all(msg190".g""^1");
    
replace_all(msg190".e""^3");
    
    if(
idplayers[0] = id; else get_players(playerscount"ch")
    {
        for(new 
0counti++)
        {
            if(
is_user_connected(players[i]))
            {
                
message_begin(MSG_ONE_UNRELIABLEg_msg_saytext_players[i])
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }

its work but found more problem.

when VIP user flag (1) its show me also [2]:
i clicked on it and show my name in list

and how can i add return on name when i press the name.
__________________
Қазақстан Республикасы

Last edited by Snitch; 08-23-2016 at 14:21.
Snitch is offline
Send a message via Skype™ to Snitch
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:34.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode