Raised This Month: $ Target: $400
 0% 

Getting users with "ADMIN_LEVEL_H" print out


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lure.d
BANNED
Join Date: Dec 2009
Location: Lithuania->USA
Old 02-09-2010 , 14:35   Getting users with "ADMIN_LEVEL_H" print out
Reply With Quote #1

Hey!
I've got a big problem. I try to find all people with "ADMIN_LEVEL_H" flag.
And to input them. Well i kinda have my own private jailbreak vip plugin so, ill just put the NEEDED parts of the code
PHP Code:
public plugin_init() {
    
register_clcmd("say /vips""print_vips");
    
register_clcmd("say_team /vips""print_vips");
}
public 
print_vips(id) {
    new 
vipnames[31][31];
    new 
plid,vipcount,x;
    for (
plid 1plid <= get_maxplayers() ; plid++;) {
        if (
is_user_connected(plid)) {
            if(
get_user_flags(plid) & ADMIN_LEVEL_H) {
            
get_user_name(plidvipnames[vipcount++], 31);
                if (
vipcount 0) {
                    for (
0countx++) {
                        
ColorChat(idTEAM_COLOR"^x04[FRUKTAI.NET] ^x03Online VIP players: ^x04%%s"vipnames[x], < (vipcount-1));
                    }
                } else {
                    
ColorChat(idTEAM_COLOR"^x04[FRUKTAI.NET] ^x03No admins online");
                }
            }
        }
    }

I just dont understand how to get them, if anyone could help me in CLEAR code so i could understand it and i really want to learn how to get them
Thanks
Lure.d is offline
Send a message via Skype™ to Lure.d
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-09-2010 , 15:10   Re: Getting users with "ADMIN_LEVEL_H" print out
Reply With Quote #2

You're making it so complicated.

Code:
#include < amxmodx > #include < amxmisc > new g_iMaxPlayers; public plugin_init( ) {     register_clcmd( "say /vips", "print_vips" );     register_clcmd( "say_team /vips", "print_vips" );         g_iMaxPlayers = get_maxplayers( ); } public print_vips( iPlayer ) {     new szName[ 32 ], iCount;         for( new i = 1; i <= g_iMaxPlayers; i++ )     {         if( is_user_connected( i ) && access( i, ADMIN_LEVEL_H ) )         {             get_user_name( i, szName, 31 );                         ColorChat( iPlayer, TEAM_COLOR, "^4[FRUKTAI.NET]^3 Online VIP Player:^4 %s", szName );                         iCount++;         }     }         if( !iCount )     {         ColorChat( iPlayer, TEAM_COLOR, "^4[FRUKTAI.NET]^3 No VIP players are online." );     } }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Lure.d
BANNED
Join Date: Dec 2009
Location: Lithuania->USA
Old 02-10-2010 , 08:36   Re: Getting users with "ADMIN_LEVEL_H" print out
Reply With Quote #3

that really works, but one correcting:
it just spams vip: name
vip: name
vip: name
and i want to be like, vip: vip1, vip2, vip3.
In one line if u understand.
Lure.d is offline
Send a message via Skype™ to Lure.d
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-10-2010 , 09:04   Re: Getting users with "ADMIN_LEVEL_H" print out
Reply With Quote #4

http://forums.alliedmods.net/showthread.php?t=26993
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Lure.d
BANNED
Join Date: Dec 2009
Location: Lithuania->USA
Old 02-10-2010 , 09:37   Re: Getting users with "ADMIN_LEVEL_H" print out
Reply With Quote #5

didnt want any plugin, but thanks again - gonna use it.
Lure.d is offline
Send a message via Skype™ to Lure.d
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-10-2010 , 10:04   Re: Getting users with "ADMIN_LEVEL_H" print out
Reply With Quote #6

You don't have to use the plugin.
The code in that plugin is almost exactly what you want.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 07:27.


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