Raised This Month: $ Target: $400
 0% 

[REQ] amx_who


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
bat
Veteran Member
Join Date: Jul 2012
Old 07-18-2013 , 02:46   Re: [REQ] amx_who
Reply With Quote #5

Code:
#include <amxmodx>

new g_groupNames[][] = {
    "--==Owner==--",
    "--==Co-Owner==--",
    "--==Moderator==--",
    "--==Admin==--",
    "--==Slot==--"
}

new g_groupFlags[sizeof(g_groupNames)][] = {
    "abcdefghijklmnopqrstu",
    "abcdefghijkmnopqrstu",
    "abcdefgijmnopqrstu",
    "bcefgijmnopqrstu",
    "abi"
}
new g_groupFlagsValue[sizeof(g_groupFlags)]

public plugin_init()
{
    register_plugin("Amx_Who", "1.0", "Author")
    register_concmd("amx_who", "cmdWho", 0)
    
    for(new i = 0; i < sizeof(g_groupNames); i++)
    {
        g_groupFlagsValue[i] = read_flags(g_groupFlags[i])
    }
}

public cmdWho(id)
{
    new hostname[64]
    get_cvar_string("hostname", hostname, 63)
    console_print(id, "===%s===", hostname)
    
    new iPlayers[32], iNumPlayers, iPlayer
    new iPlayerFlags[33], iAdminCount, iFlags
    get_players(iPlayers, iNumPlayers)
    
    for( new i = 0; i < iNumPlayers; i++ )
    {
        iPlayer = iPlayers[i]
        iFlags=get_user_flags(iPlayer)
        if( iFlags>0 && !(iFlags&ADMIN_USER) ) // is_user_admin()
        {
            iPlayerFlags[iPlayer] = iFlags
            iPlayers[iAdminCount] = iPlayer
            iAdminCount++
        }
    }

    iFlags = get_user_flags(id)
    if( iFlags & ADMIN_USER || iFlags == 0)
    {
        console_print(id, "Admins: %d", iAdminCount)
    }
    else
    {
        new szName[32], i, j
        for(i = 0; i < sizeof(g_groupNames); i++)
        {
            console_print(id, "%s - %s", g_groupNames[i], iFlags)
            for(j = 0; j < iAdminCount; j++)
            {
                iPlayer = iPlayers[j]
                if(iPlayerFlags[iPlayer] == g_groupFlagsValue[i])
                {
                    get_user_name(iPlayer, szName, 31)
                    console_print(id, "%s", szName)
                }
            }
        }
    }
    console_print(id, "===%s===", hostname)

    return PLUGIN_HANDLED
}
bat is offline
Send a message via Skype™ to bat
 



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 16:21.


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