/admins in Dialog
#4

The problem is you call the function ShowPlayerDialog 500 times (500 = MAX_PLAYERS),
because there is a for-loop. And when the server finds an admin it will show you the dialog only with one admin on the list.

Try this.

EDIT: There was en error, it's fixed now.
pawn Код:
if (strcmp(cmd, "/admins", true) == 0)
{
    new count = 0, text[128];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if (IsPlayerConnected(i))
        {
            if(AccountInfo[i][AdminLevel] >= 1 && AccountInfo[i][AdminLevel] <= 5 && Hide[i] == 0)
            {
                new playername[MAX_PLAYER_NAME];
                GetPlayerName(i, playername, sizeof(playername));
                format(string, 128, "%s          Level: %d\n",playername,AccountInfo[i][AdminLevel]);
                strins(text, string, strlen(string), sizeof(string));
                count++;
            }
        }
    }
    if (count == 0) return SendClientMessage(playerid,LILA,"Server: No Admins online yet.");
    ShowPlayerDialog(playerid,2563,DIALOG_STYLE_LIST,"Admins Online:",text,"OK","");
    strdel(text, 0, strlen(text));
    return 1;
}
Reply


Messages In This Thread
/admins in Dialog - by Youtube12 - 24.11.2012, 19:05
Re: /admins in Dialog - by park4bmx - 24.11.2012, 19:14
AW: /admins in Dialog - by Youtube12 - 24.11.2012, 19:23
AW: /admins in Dialog - by Skimmer - 24.11.2012, 19:33
AW: /admins in Dialog - by Youtube12 - 24.11.2012, 20:03
Re: /admins in Dialog - by Maikkk - 24.11.2012, 20:12
AW: /admins in Dialog - by Youtube12 - 24.11.2012, 20:23
Re: /admins in Dialog - by Maikkk - 27.11.2012, 09:02

Forum Jump:


Users browsing this thread: 1 Guest(s)