/reportlist
#1

hello i have made /report command which report a player (hacker) and sent to online admins
it works perfect it saves to ServerFiles/Log/ now the problem is how to make /reportlist show something like this

Код:
[14/03/12] [15:07:01] Reklez has report Johnny | Reason: Testing
how can i do it on dialog? here is the code.

pawn Код:
new RCount = 0;

CMD:report(playerid, params[])
{
    new string[128],
        id,
        pname[MAX_PLAYER_NAME],
        name[MAX_PLAYER_NAME],
        Year,
        Day,
        Month,
        Hour,
        Minute,
        Second,
        File:reportlog,
        reason[30];
    if(sscanf(params, "us[30]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "SYNTAX: /report <playerid/name> <reason>");
    GetPlayerName(id, name, sizeof(name));
    GetPlayerName(playerid, pname, sizeof(pname));
    getdate(Year, Month, Day);
    gettime(Hour, Minute, Second);
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid-Playerid");
    if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "You cannot report yourself!");
    format(string, sizeof(string), "REPORT: %s(ID:%d) "yellow"has report "white"%s(ID:%d) | "red"Reason: %s", pname, playerid, name, id, reason);
    MessageToAdmins(COLOR_WHITE, string);
    RCount++;
    reportlog = fopen("ServerFiles/Log/reports.txt", io_append);
    format(string, sizeof(string), "[%d/%d/%d] [%d:%d:%d]: %s has report %s for %s\r\n", Day, Month, Year, Hour, Minute, Second, pname, playerid, name, id, reason);
    fwrite(reportlog, string);
    fclose(reportlog);
    format(string, sizeof(string), "You report %s(ID:%d) | Reason: %s", name, id, reason);
    SendClientMessage(playerid, COLOR_RED, string);
    SendClientMessage(playerid, COLOR_YELLOW, "| - Your report has been sent from Online Administrators and saved from our database as .txt!");
    return 1;
}
Reply


Messages In This Thread
/reportlist - by Reklez - 14.03.2012, 12:15
Re: /reportlist - by mature1990 - 14.03.2012, 12:26
Re: /reportlist - by Reklez - 14.03.2012, 12:29
Re: /reportlist - by Tanush123 - 14.03.2012, 13:09
Re: /reportlist - by mature1990 - 14.03.2012, 13:34
Re: /reportlist - by Reklez - 16.03.2012, 05:45
Re: /reportlist - by Reklez - 16.03.2012, 06:43
Re: /reportlist - by Reklez - 16.03.2012, 09:27
Re: /reportlist - by Twisted_Insane - 16.03.2012, 09:29
Re: /reportlist - by Tanush123 - 18.03.2012, 04:06

Forum Jump:


Users browsing this thread: 3 Guest(s)