06.12.2014, 23:26
Hello, I have made this reporting system, where players can report other players and the reports save in a file, I was woudering how I could open the file into a dialog so all the reports are in a dialog. But I don't want the dialog to get filled up, so how would i delete the reports after finishing with them,
Example;
/reports
Dialog shows up:
when they click on the report
If you know how and what i mean please can you help me out here, I really need this command to work.
Codes:
Thank you if you're able to help! + rep for anyone who helps me out!
Example;
/reports
Dialog shows up:
Код:
[date][time]LeXuZ has reported Player for hacking "Open" "Close"
Код:
[date][time]LeXuZ has reported player for hacking "Ban" "Delete"
Codes:
pawn Код:
CMD:report(playerid, params[])
{
new reason[128];
if(sscanf(params, "us[128]", ID, reason)) return SCM(playerid, red, "--- /report <ID> <Reason> ---");
new string[150], sender[MAX_PLAYER_NAME], receiver[MAX_PLAYER_NAME];
GetPlayerName(playerid, sender, sizeof(sender));
GetPlayerName(ID, receiver, sizeof(receiver));
format(string, sizeof(string), "%s(%d) has reported %s(%d) for %s", sender, playerid, receiver, ID, reason);
SendReportToAdmins(string);
ReportLog(playerid, string);
return 1;
}
pawn Код:
stock ReportLog(playerid, text[])
{
new
File:lFile = fopen("Core/Logs/Report.txt", io_append),
logData[178],
fyear, fmonth, fday,
fhour, fminute, fsecond;
getdate(fyear, fmonth, fday);
gettime(fhour, fminute, fsecond);
format(logData, sizeof(logData),"[%02d/%02d/%04d %02d:%02d:%02d] (report) %s \r\n", fday, fmonth, fyear, fhour, fminute, fsecond, text);
fwrite(lFile, logData);
fclose(lFile);
SCM(playerid, red, "Reported!");
return 1;
}
pawn Код:
ACMD:reports(playerid, params[])
{
if (pInfo[playerid][Adminlevel] < 1) return 0;
ShowPlayerDialog(playerid, reports, DIALOG_STYLE_LIST, "Reports", "", "Select", "Close");//don't know what to do in here
return 1;
}