Loading reports
#1

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:

Код:
[date][time]LeXuZ has reported Player for hacking

"Open" "Close"
when they click on the report

Код:
[date][time]LeXuZ has reported player for hacking

"Ban" "Delete"
If you know how and what i mean please can you help me out here, I really need this command to work.

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;
}
Thank you if you're able to help! + rep for anyone who helps me out!
Reply


Messages In This Thread
Loading reports - by LeXuZ - 06.12.2014, 23:26
Re: Loading reports - by Kaperstone - 06.12.2014, 23:33
Re: Loading reports - by LeXuZ - 07.12.2014, 14:11
Re: Loading reports - by Sawalha - 07.12.2014, 14:28
Re: Loading reports - by BroZeus - 07.12.2014, 14:40
Re: Loading reports - by LeXuZ - 07.12.2014, 16:06
Re: Loading reports - by Sawalha - 07.12.2014, 16:08
Re: Loading reports - by LeXuZ - 07.12.2014, 16:19
Re: Loading reports - by Sawalha - 07.12.2014, 16:38
Re: Loading reports - by LeXuZ - 07.12.2014, 16:40

Forum Jump:


Users browsing this thread: 1 Guest(s)