[HELP] Show MySQL data with DialogMSGBox
#1

Hi, first, Thanks for being here reading and paying attention.

I have a CMD, "/Admins" to show a list with all admins in the table, my problem is in show it.

pawn Код:
public OnAdminsFound(playerid)
{
      new rows, fields, TotalRows;
      new nome[21], level, date[11], hide, rankx[13], temp[21], Str1[256], Str2[500];
      cache_get_data(rows, fields);
      while(TotalRows < rows)
      {
            cache_get_row(TotalRows, 1, temp), format(nome,21,temp);
            cache_get_row(TotalRows, 2, temp), level = strval(temp);
            cache_get_row(TotalRows, 4, temp), format(date,11,temp);
            cache_get_row(TotalRows, 12, temp), oculto = strval(temp);
            if (hide != 1)
            {
                if(level == 1)
                {
                    format(rankx,sizeof(rankx),"Moderator");
                }
                else if(level == 2)
                {
                    format(rankx,sizeof(rankx),"Administrator");
                }
                else if(level == 3)
                {
                    format(rankx,sizeof(rankx),"Owner");
                }
                format(Str1, sizeof(Str1), "{FFFFFF}Name: %s | Level:%i | Date: %s\n", nome,rankx,date);
                strcat(Str2, Str1);
                TotalRows++;
                ShowPlayerDialog(playerid, 1258, DIALOG_STYLE_MSGBOX, " * {FFFFFF}Administrators Online!", Str2, "Close", "");
            }

      }
      return 1;
}
So, if u can helpe me. Please!

Very thanks.
Reply
#2

For first
Код HTML:
Level:%i
should be
Код HTML:
Level:%s
Reply
#3

Oh shit, went unnoticed, thanks!

But the problem is, no show dialog =/ don't work..

When i use "/admins" nothing show
Reply
#4

Show the /admins cmd
Reply
#5

pawn Код:
CMD:admins(playerid, params[])
{
    mysql_function_query(Connect, "SELECT * FROM `admins` AND ORDER BY `Online` DESC", true, "OnAdminsFound", "i", playerid);
    return 1;
}
I have tried with SendClientMessage with another method and work.. More, when i try with Dialog don't work =/
Reply
#6

add
Код HTML:
print(str2);
under
Код HTML:
strcat(Str2, Str1);
and tell me if it is correct, maybe little string idk
Reply
#7

Very thanks for all!

I have found a problem, in CMD:
pawn Код:
mysql_function_query(Connect, "SELECT * FROM `admins` AND ORDER BY `Online` DESC", true, "OnAdminsFound", "i", playerid);
Correct, withou 'AND'
pawn Код:
mysql_function_query(Connect, "SELECT * FROM `admins` ORDER BY `Online` DESC", true, "OnAdminsFound", "i", playerid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)