View Single Post
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-25-2023 , 18:35   Re: List amx_who by nick when using CE account flags
Reply With Quote #8

Quote:
Originally Posted by cusy23 View Post
I am talking about amx_who plugin, not amx_who command. As I said before, I've tested few amx_who plugins and they are working (the output is as expected, with categories and name) only when using "a" account flag. If, I/m using CE account flags the output it's default like I have no plugin for amx_who.
If you've tested a few amx_who plugins and haven't posted a link or code for them, I don't know for sure what you're talking about. Please post a a link (if it's hosted in these forums) or attach the .sma file if it's from somewhere else so we can start with something you know you already like. This will prevent people from having to guess what exactly you're looking for and we can focus solely on the changes you want to make.

Quote:
Originally Posted by cusy23 View Post
Could you please tell me where it's this function stored? Have you modified it till now? It would be helpful for everyone if you could add it as an attachment in the thread where you have posted the plugin.
I haven't done anything yet because I'm still trying to understand what you're asking for. It seemed like you thought that the plugin I posted a link to wasn't good enough. If you can provide a plugin that I can edit that has everything but the extra info, I can add it to that plugin. Otherwise, if the plugin I posted has everything you need except the nickname I can add it to that for you.

Ultimately, I don't have a whole lot of time to waste writing/modifying plugin that you won't end up using so I would like to get it done right the first time.

Quote:
Originally Posted by cusy23 View Post
In my opinion it's related because it's exactly what I'm trying to obtain: list the admins by categories/name and show the activity by name when using CE account flags.
No. That list of instructions is for a specific request that involved modifying a significant number of AMX Mod X default functions/plugins in a very specific way which is unrelated to anything you've mentioned in this thread. If you want to be pedantic, step 1, half of step 4, and step 5 and 6 would apply if you were to use the extrainfo functionality. In fact, I would highly recommend that you DO NOT use the amxmisc.inc unless it gets updated to match the latest version that comes with AMX Mod X.


Quote:
Originally Posted by N3v3rM1nd View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>
new g_ShowAdminsFile[64]
new 
g_name[33][64]
public 
plugin_init()
{
    
register_clcmd("amx_who""who_display")
    new 
szConfigsDir[128]
    
get_configsdir(szConfigsDircharsmax(szConfigsDir))
    
formatex(g_ShowAdminsFilecharsmax(g_ShowAdminsFile), "%s/amx_who.ini"szConfigsDir)
}

public 
client_putinserver(id
{
    
get_user_name(idg_name[id], charsmax(g_name))

}

public 
who_display(id)
{
    new 
szData[999], lenszRankName[100], szFlags[100]
    new 
iPlayers[MAX_PLAYERS], iNumalt_id

    get_players
(iPlayersiNum"c")

    new 
fsize file_size(g_ShowAdminsFile1)

    
client_cmd(id"toggleconsole")
    
console_print(id"[<----======= [ADMINS] =======---->")

    for(new 
lineline <= fsize 1line++)
    {
        
read_file(g_ShowAdminsFilelineszDatacharsmax(szData), len)
        
parse(szDataszRankNamecharsmax(szRankName), szFlagscharsmax(szFlags))

        
console_print(id"[%d] %s"line 1szRankName)

        for(new 
iiNumi++)
        {
            
alt_id iPlayers[i]
            if(
get_user_flags(alt_id) == read_flags(szFlags))
                
console_print(id">>> %s"g_name[alt_id])
        }
    }
    
console_print(id"[<----======= [ADMINS] =======---->")

In configs create amx_who.ini file and add like this
Rank name flags
PHP Code:
Owner abcdefghijklmnopqrstu
Admin bcdef
Vip bit
Slot b 
It is inefficient to open and read a file every time the command is executed (and those file functions are inefficient in and of themselves unless you're only reading a single line ever).
__________________
fysiks is offline