function:ReportList(playerid) { new rows, fields; cache_get_data(rows, fields, MySQLPipeline); if(rows) { for(new row = 0; row < rows; row++) { new iMessage[128],Repotredby[128],ReporedTime[128],Reason[128], pName[MAX_PLAYER_NAME]; cache_get_field_content(row, "ReportedBy", pName, MySQLPipeline); cache_get_field_content(row, "Reported", Repotredby, MySQLPipeline); cache_get_field_content(row, "TimeDate", ReporedTime, MySQLPipeline); cache_get_field_content(row, "Reason", Reason, MySQLPipeline); format(iMessage,sizeof(iMessage),"%s - %s - %s -%s",pName,Repotredby,ReporedTime,Reason); SendClientMessage(playerid, COLOR_GREY, iMessage); return 1; } } return 1; }
COMMAND:reports(playerid, params[]) { new iQuery[300]; mysql_format(MySQLPipeline, iQuery, sizeof(iQuery), "SELECT `Reported`, `ReportedBy`, `TimeDate`, `Reason` FROM `Reports`"); mysql_tquery(MySQLPipeline, iQuery, "ReportList", "d", playerid); return 1; }
format(iMessage,sizeof(iMessage),"%s - %s - %s -%s",pName,Repotredby,ReporedTime,Reason); SendClientMessage(playerid, COLOR_GREY, iMessage); |
function:ReportList(playerid)
{
new rows, fields;
cache_get_data(rows, fields, MySQLPipeline);
if(rows)
{
new str[128 * rows], iMessage[128], Repotredby[128], ReporedTime[128], Reason[128], pName[MAX_PLAYER_NAME];
for(new i; i < rows; i++)
{
cache_get_field_content(row, "ReportedBy", pName, MySQLPipeline);
cache_get_field_content(row, "Reported", Repotredby, MySQLPipeline);
cache_get_field_content(row, "TimeDate", ReporedTime, MySQLPipeline);
cache_get_field_content(row, "Reason", Reason, MySQLPipeline);
format(iMessage, sizeof iMessage,"%d) %s - %s - %s - %s",i + 1, pName, Repotredby, ReporedTime, Reason);
strcat(str, iMessage);
}
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Reports list", str, "Okay", "");
}
return 1;
}