21.10.2018, 15:33
if it is storing data in ur database, then this should work
otherwise, there might be errors in ur logs
pawn Код:
CMD:reports(playerid, params[])
{
if(pInfo[playerid][pAdminLevel] < 1) return SendClientMessage(playerid,-1,""COL_RED"Not Admin!");
new Cache:reports = mysql_query(mysql, "SELECT * FROM `reportlog`", true);
new rows = cache_num_rows(mysql), count = 0;
SendClientMessage(playerid, -1, "Reports:");
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), "[#%d] (%s) %s has reported %s! [Reason: %s]", reportid, reportedon, reporter, reported, reportreason);
SendClientMessage(playerid, RED, showreps);
count++;
}
if(count == 0)
{
SendClientMessage(playerid, RED, "There are currently no reports!");
}
cache_delete(reports);
return 1;
}