27.11.2012, 00:25
What are your tables?
I don't really know how you want it so heres a start
I don't really know how you want it so heres a start
pawn Код:
CMD:reports(playerid, params[])
{
if(pStats[playerid][pAdmin] < 1)
return 1;
new szQuery[96], iStart = 0, iEnd = 15;
format(szQuery, sizeof(szQuery), "SELECT * FROM `reportsLog` LIMIT %d, %d", iStart, iEnd);
mysql_function_query(1, szQuery, true, "thread_LoadReports", "d", playerid);
return 1;
}
forward thread_LoadReports(playerid);
public thread_LoadReports(playerid)
{//place your ConnectionHandle var
new row, rows, fields, dest[144], BigVar[1024]; // is 144 the max report length? it's a dialog right? so you might need a large string length
cache_get_data(rows, fields);
if(rows > 0)
{
while(row < rows)
{
cache_get_row(row, 0, dest, ConnectionHandle);
format(BigVar, sizeof(BigVar), "Report ID [%d]: %s", row, dest);
++row;
}
ShowPlayerDialog(playerid, dialogid, MSGORLIST?, "Report Log", BigVar, "Select", "Close");
}
else
{
ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_MSGBOX, "Report Log", "There are no reports in this criteria", "Close", "");
}
return 1;
}