21.10.2018, 17:02
not sure about the limit, as for dialog in /reports use strcat
pawn Код:
#define DIALOG_UNUSED 1
CMD:reports(playerid, params[])
{
if(pInfo[playerid][pAdminLevel] < 1) return SendClientMessage(playerid,-1,""COL_RED"Not Admin!");
mysql_tquery(mysql, "SELECT * FROM `reportlog`", "ShowReports", "d", playerid);
return 1;
}
forward ShowReports(playerid);
public ShowReports(playerid)
{
new rows, fields, handlingarray[500];
cache_get_data(rows, fields, handle);
if(rows != 0)
{
strcat(handlingarray, "Username\t\tTargetname\t\tReason\t\tDate");
for(new i = 0; i < rows; i++)
{
new reporter[MAX_PLAYER_NAME], reported[MAX_PLAYER_NAME], reportid, reportedon[25], reportreason[25], showreps[200];
reportid = cache_get_field_content_int(i, "ID");
cache_get_field_content(i, "Username", reporter);
cache_get_field_content(i, "Targetname", reported);
cache_get_field_content(i, "Data", reportedon);
cache_get_field_content(i, "Report", reportreason);
format(showreps, sizeof(showreps), "%s\t\t%s\t\t%s\t\t%s", reporter, reported, reportreason, reportdon);
strcat(handlingarray, showreps);
}
ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_TABLIST_HEADERS, "Reports", handlingarray, "OK", "");
}
else if(rows == 0)
{
SendClientMessage(playerid, RED, "There are currently no reports!");
}
return 1;
}