Raised This Month: $12 Target: $400
 3% 

List amx_who by nick when using CE account flags


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cusy23
Junior Member
Join Date: Aug 2010
Old 01-23-2023 , 13:16   List amx_who by nick when using CE account flags
Reply With Quote #1

Hello,

Currently I'm adding the admins using CE account flags(by steamid) on my steam-only server:

"STEAM_0:0:789012" "" "abcdefghijklmnopqrstu" "ce" ; I can have any name and still have admin access.

I would like to know if there is any way to have the output similar with the clasic amx_who plugin (when you are using "a" account flag (a - disconnect player on invalid password)).
Maybe this can be achieved by adding a new parameter (nick) and list the amx_who by that nick.
For example:

"STEAM_0:0:789012" "" "abcdefghijklmnopqrstu" "ce" "cusy23" ;

Also, you should be able to add into the new amx_who plugin the admin groups/categories and list them in the output. For example:

---Owners---
cusy23

---Moderators---
cusy24

---Helpers---
cusy25


Thank you in advance !
cusy23 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-24-2023 , 01:39   Re: List amx_who by nick when using CE account flags
Reply With Quote #2

What do you mean by "classic amx_who plugin"?

I found a custom amx_who command that I helped someone with way back that looks like it has the last part of your request here. Try this one out (the one in my post), modify the category names and flags as needed. It might be a good start to add other stuff.

Regarding the permanent nick name, yes, that is possible. I even created a plugin to create an API to do this.
__________________
fysiks is offline
cusy23
Junior Member
Join Date: Aug 2010
Old 01-24-2023 , 07:44   Re: List amx_who by nick when using CE account flags
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
What do you mean by "classic amx_who plugin"?

I found a custom amx_who command that I helped someone with way back that looks like it has the last part of your request here. Try this one out (the one in my post), modify the category names and flags as needed. It might be a good start to add other stuff.

Regarding the permanent nick name, yes, that is possible. I even created a plugin to create an API to do this.
By clasic amx_who plugin I was referring to something similar with what you gave me above used by most of the servers but it looks like they are working fine only when using "a" account flag (a - disconnect player on invalid password) because it's returning the name in this case. I've tried few and is not working when using CE account flags (c - this is steamid/wonid, e - password is not checked (only name/ip/steamid needed)).

Does this one from here works fine also with CE account flags? I will try it in any case. I guess it will return the steamid.

Now, regarding the API to add the nick name, based on it, we should have an additional plugin for amx_who which should check in users.ini what's the nickname for each steamid with access flags and return them within amx_who command. Please correct me if I'm wrong. I will try to see if I can make it work with the information provided. Thanks

Last edited by cusy23; 01-24-2023 at 08:06.
cusy23 is offline
cusy23
Junior Member
Join Date: Aug 2010
Old 01-24-2023 , 10:20   Re: List amx_who by nick when using CE account flags
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
What do you mean by "classic amx_who plugin"?

Regarding the permanent nick name, yes, that is possible. I even created a plugin to create an API to do this.
I was checking the info for this part:

Code:
1. Install the plugin native_getuserextrainfo.amxx like any other plugin.
2. Put both includes in your /amxmodx/scripting/include/ folder.
3. Recompile any plugin that uses show_activity(), show_activity_id(), or show_activity_key().
4. Install the newly compile plugins in place of the existing ones.
5. Add info to users.ini as shown in the first post in the mentioned thread.
6. Test.
1. It's clear
2. It's clear, I will have to overwrite the current amxmisc.inc and put also getuserextrainfo.inc.
3-4. It's not clear for me which are these plugins. I have amx_show_activity 2 set into amxx.cfg but I don't know which plugin it's setting it. Maybe admincmd.amxx ? If I'm not doing these two steps I suppose there is no problem (I will not see the admins activity with the name from the users.ini, right ?)
4-5. Clear

Additionally, If I'm using the plugin for amx_who you mentioned above, is it compatible with this API ? Will it show the admin name (extra argument added at the end of each row into users.ini) without doing steps 3 and 4 ?

Thank you in advance for your response !
cusy23 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-25-2023 , 00:19   Re: List amx_who by nick when using CE account flags
Reply With Quote #5

Quote:
Originally Posted by cusy23 View Post
By clasic amx_who plugin I was referring to something similar with what you gave me above used by most of the servers but it looks like they are working fine only when using "a" account flag (a - disconnect player on invalid password) because it's returning the name in this case. I've tried few and is not working when using CE account flags (c - this is steamid/wonid, e - password is not checked (only name/ip/steamid needed)).

Does this one from here works fine also with CE account flags? I will try it in any case. I guess it will return the steamid.
I still have no idea what you're talking about. The amx_who command in AMX Mod X has nothing to do with the account flags. amx_who simply loops through all players and outputs relevant data. The only types of flags that it checks is the access flags and even then it's only to check if the player has immunity and reservation.

The amx_who command in AMX Mod X hasn't change fundamentally for basically the entire life of AMX Mod X (at least back to 2004).

Quote:
Originally Posted by cusy23 View Post
Now, regarding the API to add the nick name, based on it, we should have an additional plugin for amx_who which should check in users.ini what's the nickname for each steamid with access flags and return them within amx_who command. Please correct me if I'm wrong. I will try to see if I can make it work with the information provided. Thanks
It won't just work by installing the plugin. You'd need to modify the code of the amx_who function to incorporate this function to use the data from it. And, again, it has nothing to do with account flags (everybody should be set up by SteamID so it won't really matter anyways).

Quote:
Originally Posted by cusy23 View Post
I was checking the info for this part:

Code:
1. Install the plugin native_getuserextrainfo.amxx like any other plugin.
2. Put both includes in your /amxmodx/scripting/include/ folder.
3. Recompile any plugin that uses show_activity(), show_activity_id(), or show_activity_key().
4. Install the newly compile plugins in place of the existing ones.
5. Add info to users.ini as shown in the first post in the mentioned thread.
6. Test.
1. It's clear
2. It's clear, I will have to overwrite the current amxmisc.inc and put also getuserextrainfo.inc.
3-4. It's not clear for me which are these plugins. I have amx_show_activity 2 set into amxx.cfg but I don't know which plugin it's setting it. Maybe admincmd.amxx ? If I'm not doing these two steps I suppose there is no problem (I will not see the admins activity with the name from the users.ini, right ?)
4-5. Clear

Additionally, If I'm using the plugin for amx_who you mentioned above, is it compatible with this API ? Will it show the admin name (extra argument added at the end of each row into users.ini) without doing steps 3 and 4 ?

Thank you in advance for your response !
That list of instructions is very specific to the plugin in the thread where you found it. It is not related to this situation.
__________________
fysiks is offline
cusy23
Junior Member
Join Date: Aug 2010
Old 01-25-2023 , 02:20   Re: List amx_who by nick when using CE account flags
Reply With Quote #6

Quote:
Originally Posted by fysiks View Post
I still have no idea what you're talking about. The amx_who command in AMX Mod X has nothing to do with the account flags. amx_who simply loops through all players and outputs relevant data. The only types of flags that it checks is the access flags and even then it's only to check if the player has immunity and reservation.

The amx_who command in AMX Mod X hasn't change fundamentally for basically the entire life of AMX Mod X (at least back to 2004).
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.

Quote:
Originally Posted by fysiks View Post
It won't just work by installing the plugin. You'd need to modify the code of the amx_who function to incorporate this function to use the data from it. And, again, it has nothing to do with account flags (everybody should be set up by SteamID so it won't really matter anyways).
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.

Quote:
Originally Posted by fysiks View Post
That list of instructions is very specific to the plugin in the thread where you found it. It is not related to this situation.
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.

Last edited by cusy23; 01-25-2023 at 02:35.
cusy23 is offline
N3v3rM1nd
Junior Member
Join Date: Apr 2021
Old 01-25-2023 , 04:45   Re: List amx_who by nick when using CE account flags
Reply With Quote #7

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 
N3v3rM1nd is offline
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
cusy23
Junior Member
Join Date: Aug 2010
Old 01-26-2023 , 08:21   Re: List amx_who by nick when using CE account flags
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
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.



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.
I've tested something similar with this(if you search on google for "amx_who plugin generator", there are already few apps for this):

https://forums.alliedmods.net/showthread.php?t=248837

All I want is to list the online admins on server with rank/nickname(instead of steamid) when using amx_who command although I'm adding them in users.ini by steamid(CE flags).

And as you said, the plugin you have posted, has everything I want except the nickname. If you can modify the plugin and add it so I can list the online admins by nickname instead of steam id, I will definitely use it. Thank you in advance for this and I'm sorry because I wasn't able to better explain what I want.

Last edited by cusy23; 01-26-2023 at 09:10.
cusy23 is offline
cusy23
Junior Member
Join Date: Aug 2010
Old 01-26-2023 , 09:31   Re: List amx_who by nick when using CE account flags
Reply With Quote #10

Update: I've tested your plugin, and at a first try it wasn't doing anything. The plugin was in running state but without any relevance:

Amx_Who 1.0 AUTHOR amx_who.amxx running

# nick authid userid imu rez acces
1 cusy23 STEAM_0:0xxx 3 Yes Yes abcdefghijklmnopqrstuvy

I was thinking that is somehow overwritten by the default one which amxmodx comes and I put it in front of all the others plugins. And now it works fine(this explains also why the other plugins were not working).

Code:
===CS.something.RO - [STEAM ONLY]===
--==Skillsv-Founder==--
cusy23
--==Skillsv-Owners==--
--==Skillsv-Moderators==--
--==Skillsv-Admins==--
--==Skillsv-Helpers==--
===CS.something.RO - [STEAM ONLY]===
So, i think I'm fine with this. If I have the name with which the admins are playing when they are on the server, I'm fine also without the nick name.

If you have time, it would be a nice to have feature but I'm fine also with what I have now.

Thank you very much for your help !
cusy23 is offline
Reply


Thread Tools
Display Modes

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 04:22.


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