/admins problem
#2

You have to use the previous "string" (I improved it a little):
pawn Код:
dcmd_admins( playerid, params[ ] )
{
    #pragma unused params
    new count = 0, string[ 1024 ], name[ 50 ], name1[ MAX_PLAYER_NAME ];
    for( new i = 0; i < MAX_PLAYERS; i ++ )
    {
        if( IsPlayerConnected( i ) )
        {
            GetPlayerName( i, name1, MAX_PLAYER_NAME );
            if( AdminLevel[ i ] > 0 )
            {
                switch( AdminLevel[ i ] )
                {
                    case 1: name = "{FFFF00}Server Moderator {FFFFFF}(Level 1)";
                    case 2: name = "{0000BB}Global Moderator {FFFFFF}(Level 2)";
                    case 3: name = "{ADFF2F}Administrator {FFFFFF}(Level 3)";
                    case 4: name = "{ADFF2F}Lead Adminstrator {FFFFFF}(Level 4)";
                    case 5: name = "{FF0000}Owner {FFFFFF}(Level 5)";
                }

                format( string, 1024, "%s\"%s\" {%s}\n", string, name1, name );
                ShowPlayerDialog( playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, "ADMINS ONLINE", string, "Ok", "" );
                count ++;
            }
        }
    }

    if( count == 0 )
        SendClientMessage( playerid, COLOR_ADMIN,"There are no admins Online at the moment" );

    return 1;
}
Also, use foreach in your loops, it's faster.
Reply


Messages In This Thread
/admins problem - by nor15 - 14.06.2013, 18:38
Re: /admins problem - by IstuntmanI - 14.06.2013, 18:45

Forum Jump:


Users browsing this thread: 1 Guest(s)