AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [REQ] amx_who (https://forums.alliedmods.net/showthread.php?t=216803)

ScrappeR 05-25-2013 16:23

[REQ] amx_who
 
PHP 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 
0sizeof(g_groupNames); i++)
    {
        
g_groupFlagsValue[i] = read_flags(g_groupFlags[i])
    }
}

public 
cmdWho(id)
{
    new 
hostname[64]
    
get_cvar_string("hostname"hostname63)
    
console_print(id"===%s==="hostname)
    
    new 
iPlayers[32], iNumPlayersiPlayer
    
new iPlayerFlags[33], iAdminCountiFlags
    get_players
(iPlayersiNumPlayers)
    
    for( new 
0iNumPlayersi++ )
    {
        
iPlayer iPlayers[i]
        
iFlags=get_user_flags(iPlayer)
        if( 
iFlags>&& !(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], ij
        
for(0sizeof(g_groupNames); i++)
        {
            
console_print(id"%s"g_groupNames[i])
            for(
0iAdminCountj++)
            {
                
iPlayer iPlayers[j]
                if(
iPlayerFlags[iPlayer] == g_groupFlagsValue[i])
                {
                    
get_user_name(iPlayerszName31)
                    
console_print(id"%s"szName)
                }
            }
        }
    }
    
console_print(id"===%s==="hostname)

    return 
PLUGIN_HANDLED


Can someone edited this script example..

--==Owner==--
ScrappeR, Acces: abcdefghijklmnopqrstu
--==Co-Owner==--
Flooow, Acces: abcdefghijkmnopqrstu

thanks its very cool i like it..

bat 07-18-2013 02:46

Re: [REQ] amx_who
 
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
}


ScrappeR 10-01-2013 14:18

Re: [REQ] amx_who
 
Not work?

Baws 10-01-2013 16:43

Re: [REQ] amx_who
 
Quote:

Originally Posted by ScrappeR (Post 1958411)
Can someone edited this script example..

--==Owner==--
ScrappeR, Acces: abcdefghijklmnopqrstu
--==Co-Owner==--
Flooow, Acces: abcdefghijkmnopqrstu

thanks its very cool i like it..

You saying changing Owner to ScrappeR and Co-Owner to Flooow? if so then this is the code.

PHP Code:

#include <amxmodx>

new g_groupNames[][] = {
    
"--==ScrappeR==--",
    
"--==Flooow==--",
    
"--==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 
0sizeof(g_groupNames); i++)
    {
        
g_groupFlagsValue[i] = read_flags(g_groupFlags[i])
    }
}

public 
cmdWho(id)
{
    new 
hostname[64]
    
get_cvar_string("hostname"hostname63)
    
console_print(id"===%s==="hostname)
    
    new 
iPlayers[32], iNumPlayersiPlayer
    
new iPlayerFlags[33], iAdminCountiFlags
    get_players
(iPlayersiNumPlayers)
    
    for( new 
0iNumPlayersi++ )
    {
        
iPlayer iPlayers[i]
        
iFlags=get_user_flags(iPlayer)
        if( 
iFlags>&& !(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], ij
        
for(0sizeof(g_groupNames); i++)
        {
            
console_print(id"%s"g_groupNames[i])
            for(
0iAdminCountj++)
            {
                
iPlayer iPlayers[j]
                if(
iPlayerFlags[iPlayer] == g_groupFlagsValue[i])
                {
                    
get_user_name(iPlayerszName31)
                    
console_print(id"%s"szName)
                }
            }
        }
    }
    
console_print(id"===%s==="hostname)

    return 
PLUGIN_HANDLED



ScrappeR 10-01-2013 18:14

Re: [REQ] amx_who
 
lool look this !!!

--==Owner==--
ScrappeR, Acces: abcdefghijklmnopqrstu
--==Co-Owner==--
Flooow, Acces: abcdefghijkmnopqrstu

Baws 10-01-2013 21:50

Re: [REQ] amx_who
 
Quote:

Originally Posted by ScrappeR (Post 2043924)
lool look this !!!

--==Owner==--
ScrappeR, Acces: abcdefghijklmnopqrstu
--==Co-Owner==--
Flooow, Acces: abcdefghijkmnopqrstu

I don't get what you mean lol. But if you speak other languages tell me in it please.


*I talk Arab, Spanish, French, English.


All times are GMT -4. The time now is 16:21.

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