CMD:pendingreports(playerid,params[])
{
if(AdminLevel[playerid] >=2)
{
new str[1024], string2[1024], string[1024], file[25];
for(new i = 1; i < MAX_REPORTS; i++)
{
format(file, sizeof(file), "Data/Reports/r%d.ini", i);
format(ReportInfo[i][ReportedBy], 256, "%s", dini_Get(file, "ReportedBy"));
format(ReportInfo[i][ReportedReason], 256, "%s", dini_Get(file, "ReportedReason"));
format(ReportInfo[i][ReportedName], 256, "%s", dini_Get(file, "ReportedName"));
ReportInfo[i][ReportID]=INI_Int(file,"ReportID");
if(ReportInfo[i][ReportID] == 0) break;
format(str,sizeof(str),"%s\t%s\t%s\t%d\n",ReportInfo[i][ReportedName],ReportInfo[i][ReportedBy],dini_Get(file, "ReportedReason"),ReportInfo[i][ReportID]);
strcat(string2,str);
}
format(str,sizeof(str),"Reported\tReported By\tReason\tReport ID\n%s", string2);
strcat(string,str);
ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_TABLIST_HEADERS, "Pending Reports", string, "Ok", "");
}
return 1;
}
enum ReportData
{
ReportedName,
ReportedBy,
ReportedReason[50],
ReportID,
};
PHP код:
|
enum ReportData
{
ReportedName[20],
ReportedBy[20],
ReportedReason[50],
ReportID,
};
format(ReportInfo[i][ReportedBy], 20, "%s", dini_Get(file, "ReportedBy"));
format(ReportInfo[i][ReportedReason], 50, "%s", dini_Get(file, "ReportedReason"));
format(ReportInfo[i][ReportedName], 20, "%s", dini_Get(file, "ReportedName"));