/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
#2

is this working perfect? can be use the code?
Reply
#3

sure you can. but credits to me
Reply
#4

pawn Код:
format(string, sizeof(string), "You report %s(ID:%d) | Reason: %s", name, id, reason);
    ShowPlayerDialog(playerid,1518,DIALOG_STYLE_MSGBOX,"You have successfully reported",string,"Close","");
Reply
#5

ok i will credit thanks
Reply
#6

anyone?
Reply
#7

i also found one problem here it is

Код:
[16/3/2012] [14:44:41]: Reklez has report  for Reklez
i test it with myself
Reply
#8

^^^^
Reply
#9

Dude, check out my signature! I think it's the second tutorial, pretty sure you'll like it!
Reply
#10

Quote:
Originally Posted by Tanush123
Посмотреть сообщение
pawn Код:
format(string, sizeof(string), "You report %s(ID:%d) | Reason: %s", name, id, reason);
    ShowPlayerDialog(playerid,1518,DIALOG_STYLE_MSGBOX,"You have successfully reported",string,"Close","");
Are you really blind? I post it like few days ago... I think this is what you mean, you must edit your format(string and do the above
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)