[HELP] Show MySQL data with DialogMSGBox -
iryston - 08.08.2014
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.
Re: [HELP] Show MySQL data with DialogMSGBox -
Matess - 08.08.2014
For first
should be
Re: [HELP] Show MySQL data with DialogMSGBox -
iryston - 08.08.2014
Oh shit, went unnoticed, thanks!
But the problem is, no show dialog =/ don't work..
When i use "/admins" nothing show
Re: [HELP] Show MySQL data with DialogMSGBox -
Sawalha - 08.08.2014
Show the /admins cmd
Re: [HELP] Show MySQL data with DialogMSGBox -
iryston - 08.08.2014
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 =/
Re: [HELP] Show MySQL data with DialogMSGBox -
Matess - 08.08.2014
add
under
Код HTML:
strcat(Str2, Str1);
and tell me if it is correct, maybe little string idk
Re: [HELP] Show MySQL data with DialogMSGBox -
iryston - 08.08.2014
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);