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

amx_who showing admin's name


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jack86
Veteran Member
Join Date: Dec 2008
Location: Belgrade, Serbia
Old 01-01-2010 , 18:24   amx_who showing admin's name
Reply With Quote #1

Is it possible to make an edit to amx_who command so that command in some field displays admins name , cause often i dont know which one of my admins is it, they change their nicknames every 2 days. I was thinking of something like this, in users.ini it would be

"STEAM_0:1:23456789" "" "abcdefghijmnqu" "ce" "name"

and amx_who could read the part where name is written and display it, if adding another field on that line doesn't disturb normal reading of users.ini
__________________

Jack86 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-02-2010 , 04:10   Re: amx_who showing admin's name
Reply With Quote #2

I believe that would require re-reading the user.ini file in admincmd.sma and then storing that value indexed by SteamID. Then using that to print to screen in the actual amx_who function. I guess it wouldn't be too hard.

As far as I can tell it shouldn't change the functionality of loading users.ini by admin.sma
__________________
fysiks is offline
Jack86
Veteran Member
Join Date: Dec 2008
Location: Belgrade, Serbia
Old 01-02-2010 , 17:33   Re: amx_who showing admin's name
Reply With Quote #3

I'm gonna try to do it myself the way u described, but i'm not sure in my success
__________________

Jack86 is offline
Jack86
Veteran Member
Join Date: Dec 2008
Location: Belgrade, Serbia
Old 01-19-2010 , 20:56   Re: amx_who showing admin's name
Reply With Quote #4

I'm trying to do this but im stuck at saving and reading data from array, when i get authid and name from users.ini, how can i save them in array like g_userData[authid][name], how should i define that array and how can i read array while looping throu players and compare authids ?
__________________

Jack86 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-20-2010 , 00:12   Re: amx_who showing admin's name
Reply With Quote #5

Quote:
Originally Posted by Jack86 View Post
how can i save them in array like g_userData[authid][name], how should i define that array and how can i read array while looping throu players and compare authids ?
I think this situation is perfect for Tries. I did some testing and I will post my test code. It reads the users.ini file and gets the "name" that you specify. The SteamID is the key and the Name is the value.

Then just use authid from cmdWho in TrieGetString where I have a SteamID.


PHP Code:
new Trie:trieSteamID_Name

public cmdCmd(idlevelcid)
{
    new 
usersfile[64]
    
get_configsdir(usersfilesizeof(usersfile) - 1)
    
add(usersfilesizeof(usersfile) - 1"/users.ini")
    
    if( !
file_exists(usersfile) )
    {
        return
    }
    
    
trieSteamID_Name TrieCreate()
    
    new 
fopen(usersfile"rt")
    
    new 
data[128], szSteamID[32], szName[32]

    while( !
feof(f) ) 
    { 
        
fgets(fdatasizeof(data) - 1)
         
        
trim(data)
        if( !
data[0] || data[0] == ';' || data[0] == '/' && data[1] == '/' ) continue;
        
parse(dataszSteamIDcharsmax(szSteamID), ""0""0""0szNamecharsmax(szName))
        if(
szName[0])
        {
            
TrieSetString(trieSteamID_NameszSteamIDszName)
            
server_print("Info>> %s <<>> %s <<"szSteamIDszName)
        }
        
szName[0] = 0
    
}
    
    
fclose(f)
    
    print()
}

print()
{
    new 
szString[32]
    
TrieGetString(trieSteamID_Name"STEAM_0:0:12345"szStringcharsmax(szString))
    
    
server_print("Name: %s"szString)

__________________
fysiks is offline
Old 01-20-2010, 04:49
SpILL
This message has been deleted by SpILL. Reason: Needless.
Jack86
Veteran Member
Join Date: Dec 2008
Location: Belgrade, Serbia
Old 01-20-2010 , 09:25   Re: amx_who showing admin's name
Reply With Quote #6

@Spill
This doesnt change their name in chat, i just displays the name from users.ini when amx_who is used
@Fysiks
All i can say is tnx again, u helped me so many times i lost count
__________________

Jack86 is offline
user-cfg
Junior Member
Join Date: Nov 2006
Old 12-07-2010 , 06:03   Re: amx_who showing admin's name
Reply With Quote #7

how can i apply this rule to the amx_show_activity? what i mean is: my server is set to amx_show_activity 2 - showing name of admin that used the command. How could i set it to show one name regardless of the admin's nickname?
user-cfg is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-07-2010 , 17:33   Re: amx_who showing admin's name
Reply With Quote #8

Quote:
Originally Posted by user-cfg View Post
how can i apply this rule to the amx_show_activity? what i mean is: my server is set to amx_show_activity 2 - showing name of admin that used the command. How could i set it to show one name regardless of the admin's nickname?
It would require a lot of work. If I think of an "easy" way to do it I will let you know.

EDIT: Finished here.
__________________

Last edited by fysiks; 12-07-2010 at 23:02.
fysiks is offline
Reply



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 06:54.


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