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

amx_show_activity undocumented possibilities


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hammerfallerz
Senior Member
Join Date: Feb 2008
Old 01-03-2010 , 17:15   amx_show_activity undocumented possibilities
Reply With Quote #1

I'm just curious: long time ago I've requested if somebody could gimme a hint how to make it so when admin uses some command, players can NOT see admin nickname in chat, while other admins can.
Thanks to Exolent, because he told me of undocumented possibilities to put amx_show_activity 3, 4 or 5 (I believe 3 does exactly what I suggested).
Why it's undocumented? It's extremely useful, but it's not working well with most 3rd person plugins, because most probably majority of coders dont even know about it.

If somebody doesnt also know about it, check amxmisc.inc in include folder.
PHP Code:
        case 5// hide name only to admins, show nothing to normal users
        
{
            new 
__maxclients=get_maxplayers();
            
            
            for (new 
i=1i<=__maxclientsi++)
            {
                if (
is_user_connected(i))
                {
                    if (
is_user_admin(i))
                    {
                        
client_print(iprint_chat"%L: %s"iprefixbuffer);
                    }
                }
            }
        }
        case 
4// show name only to admins, show nothing to normal users
        
{
            new 
__maxclients=get_maxplayers();
            
            for (new 
i=1i<=__maxclientsi++)
            {
                if (
is_user_connected(i))
                {
                    if (
is_user_admin(i))
                    {
                        
client_print(iprint_chat"%L %s: %s"iprefixnamebuffer);
                    }
                }
            }
        }
        case 
3// show name only to admins, hide name from normal users
        
{
            new 
__maxclients=get_maxplayers();
            
            for (new 
i=1i<=__maxclientsi++)
            {
                if (
is_user_connected(i))
                {
                    if (
is_user_admin(i))
                    {
                        
client_print(iprint_chat"%L %s: %s"iprefixnamebuffer);
                    }
                    else
                    {
                        
client_print(iprint_chat"%L: %s"iprefixbuffer);
                    }
                }
            }
        }
        case 
2// show name to all
        
{
            
client_print(0print_chat"%L %s: %s"LANG_PLAYERprefix name buffer );
        }
        case 
1// hide name to all
        
{
            
client_print(0print_chat"%L: %s"LANG_PLAYERprefixbuffer );
        } 

Last edited by Hammerfallerz; 01-03-2010 at 17:17.
Hammerfallerz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-03-2010 , 17:30   Re: amx_show_activity undocumented possibilities
Reply With Quote #2

If plugins don't use the stock show_activity() and instead make their own equivalent then you don't get that flexibility.

I like #3 .
__________________
fysiks is offline
Old 01-03-2010, 17:58
Hammerfallerz
This message has been deleted by YamiKaitou. Reason: delete it yourself
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-03-2010 , 18:44   Re: amx_show_activity undocumented possibilities
Reply With Quote #3

Quote:
Originally Posted by Hammerfallerz View Post
Why it's undocumented?
Because it is a relatively new feature and nobody really used show_activity() that much anyways, hence why most 3rd party plugins don't see 3+ as valid options.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Hammerfallerz
Senior Member
Join Date: Feb 2008
Old 01-04-2010 , 01:42   Re: amx_show_activity undocumented possibilities
Reply With Quote #4

But if that would be documented, most of the coders would probably be making their plugins to support that feature :-/
Hammerfallerz is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-04-2010 , 10:57   Re: amx_show_activity undocumented possibilities
Reply With Quote #5

Then feel free to add it to the documentation. The wiki is editable by all and we encourage users to edit and add to it.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Hammerfallerz
Senior Member
Join Date: Feb 2008
Old 01-04-2010 , 11:45   Re: amx_show_activity undocumented possibilities
Reply With Quote #6

Well, most people never visit wiki for it. About documenting I more mean amxx.cfg:
Quote:
// Show admins activity
// 0 - disabled
// 1 - show without admin name
// 2 - show with name
//
// Default value: 2
amx_show_activity 1
If default amxx.cfg, that comes in AMXX package, would contain info about 3, 4 and 5, then by now most of coders would probably make their plugin not only for 1 or 2. :-/

Anyway, thanks for reply.
Hammerfallerz is offline
Old 01-04-2010, 20:20
jenygs09
This message has been deleted by YamiKaitou. Reason: spam
Dygear
SourceMod Donor
Join Date: Apr 2004
Location: Levittown, NY
Old 01-05-2010 , 02:27   Re: amx_show_activity undocumented possibilities
Reply With Quote #7

Code:
new __maxclients=get_maxplayers();

Should that not be, get_players(), as it's less wasteful, and you don't have to check if the client is connected, because by them being in the array, then they are connected.
__________________
Dygear is offline
Send a message via AIM to Dygear Send a message via MSN to Dygear Send a message via Skype™ to Dygear
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 23:21.


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