SA-MP Forums Archive
/reportlist - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /reportlist (/showthread.php?tid=325678)



/reportlist - Reklez - 14.03.2012

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;
}



Re: /reportlist - mature1990 - 14.03.2012

is this working perfect? can be use the code?


Re: /reportlist - Reklez - 14.03.2012

sure you can. but credits to me


Re: /reportlist - Tanush123 - 14.03.2012

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","");



Re: /reportlist - mature1990 - 14.03.2012

ok i will credit thanks


Re: /reportlist - Reklez - 16.03.2012

anyone?


Re: /reportlist - Reklez - 16.03.2012

i also found one problem here it is

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


Re: /reportlist - Reklez - 16.03.2012

^^^^


Re: /reportlist - Twisted_Insane - 16.03.2012

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


Re: /reportlist - Tanush123 - 18.03.2012

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