AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Getting users with "ADMIN_LEVEL_H" print out (https://forums.alliedmods.net/showthread.php?t=118287)

Lure.d 02-09-2010 14:35

Getting users with "ADMIN_LEVEL_H" print out
 
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 :P
Thanks :crab:

Exolent[jNr] 02-09-2010 15:10

Re: Getting users with "ADMIN_LEVEL_H" print out
 
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." );     } }

Lure.d 02-10-2010 08:36

Re: Getting users with "ADMIN_LEVEL_H" print out
 
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.

Exolent[jNr] 02-10-2010 09:04

Re: Getting users with "ADMIN_LEVEL_H" print out
 
http://forums.alliedmods.net/showthread.php?t=26993

Lure.d 02-10-2010 09:37

Re: Getting users with "ADMIN_LEVEL_H" print out
 
didnt want any plugin, but thanks again - gonna use it.

Exolent[jNr] 02-10-2010 10:04

Re: Getting users with "ADMIN_LEVEL_H" print out
 
You don't have to use the plugin.
The code in that plugin is almost exactly what you want.


All times are GMT -4. The time now is 07:27.

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