Raised This Month: $ Target: $400
 0% 

Read users.ini and list on motd. *Need Help*


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 04-25-2011 , 10:24   Re: Read users.ini and list on motd. *Need Help*
Reply With Quote #2

something like this should do:
PHP Code:
#include <amxmodx>

#define PLUGIN  "Users list on motd"
#define VERSION "1.0"
#define AUTHOR  "Sonedit test 8"

new flag[]="abcdefghijklmnopqrstu!!!yz"

new g_maxplayers

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("adminlist""clcmd_adminlist")
    
register_clcmd("say adminlist""clcmd_adminlist")
    
register_clcmd("say /adminlist""clcmd_adminlist")
    
    
g_maxplayers get_maxplayers()
}

public 
clcmd_adminlist(id)
{
    static 
ilstrtemp[2048], strtemp2[32]
    
    
strtemp=""
    
    
for (i=0;i<=g_maxplayers;i++)
    {
        if (!
is_user_connected(i))
            continue

        
get_user_name(istrtemp2charsmax(strtemp2))
        
add(strtempcharsmax(strtemp), strtemp2charsmax(strtemp2))
        
add(strtempcharsmax(strtemp), " flags: "strlen(" flags: "))
        
        for (
l=0;l<26;l++)
            if (
get_user_flags(i,0)&(1<<l))
                
add(strtempcharsmax(strtemp), flag[l], 1)
    }
    
    
add(strtempcharsmax(strtemp), "^n"1)

    
show_motd(idstrtemp"Admin or Vip List")
    
    return 
PLUGIN_HANDLED

Not tested.

To understand what " if (get_user_flags(i,0)&(1<<l))" does, check amxmodx.inc for info, everything will be crystal clear for you, if you will do that.
__________________


Last edited by SonicSonedit; 04-25-2011 at 10:28. Reason: forgot "if (!is_user_connected(i))" check statement
SonicSonedit is offline
 



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 19:52.


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