for scripting professional! rep++
#1

hello guys i got this /admins command :
pawn Код:
dcmd_admins(playerid,params[])
{
    #pragma unused params

        if(AccInfo[playerid][Level] >= 0)
        {
            new bool:First2 = false;
            new Count, i;
            new string[128];
            new adminname[MAX_PLAYER_NAME];
            for(i = 0; i < MAX_PLAYERS; i++)
            if(IsPlayerConnected(i) && AccInfo[i][Level] > 0)
            Count++;

            if(Count == 0)
            return SendClientMessage(playerid,red, "No admins online.");

            for(i = 0; i < MAX_PLAYERS; i++)
            if(IsPlayerConnected(i) && AccInfo[i][Level] > 0)
            {
                if(AccInfo[i][Level] > 0)
                {
                    switch(AccInfo[i][Level])
                    {
                case 1: AdmRank = "Tester";
                case 2: AdmRank = "Co-Mod";
                case 3: AdmRank = "Mod";
                case 4: AdmRank = "Admin";
                case 5: AdmRank = "{05BDFA}Leader{FF0000}";
                case 6: AdmRank = "{05BDFA}Manager{FF0000}";
                    }
                }
                GetPlayerName(i, adminname, sizeof(adminname));
                if(!First2)
                {
                    format(string, sizeof(string), "{05BDFA}Online admins:{FF0000} %s [%s]", PlayerName2(i),AdmRank);
                    First2 = true;
                }
                    else format(string,sizeof(string),"%s, %s [%s]",string, PlayerName2(i),AdmRank);
            }
            return SendClientMessage(playerid,red,string);
        }
        else return ErrorMessages(playerid, 1);
}
when more than 86 characters of admins like player1[rank], player2[rank], player3[ra (this part doesn't show anymore}
so what i need is to make when more than 2admins online to write the others on another line
please it would be awesome if you help
Reply
#2

Change this:
pawn Код:
new string[128];
To:
pawn Код:
new string[256]; // Or put any number in those brackets [] that you want. This changes the strings char length.
Reply
#3

so it will skip line when more than it exeeds 256?
Reply
#4

Well no. It will just keep going onto the same line, and eventually cut off the screen.
You will need to compare the strings, using 2 different string lengths for that.

Why dont you just make it where it sets each admin on a new line, instead of all on the same line?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)