[Tutorial] How to make a report command.
#9

This is rather simplier.

pawn Code:
CMD:report(playerid, params[])
{
    if ( sscanf( params, "us", params[ 0 ], params[ 1 ] ) )
        return SendUsage( playerid, "/report <Player's Name/ID> [report message]");
    FormMessage( playerid, COLOR_PINK, "You reported %s to the Administrators, the report has been saved into a file!",PlayerName2( params[ 0 ] ) );

    new S,M,H,D,Mo,Y,STTRR[512],File:file;
    file = fopen("Administration/Extras/Reports.txt", io_append);
    getdate(Y,Mo,D),gettime(H,M,S);
    format(STTRR, sizeof( STTRR ), "[DATE: %d/%d/%d] [TIME: %d/%d/%d]: Player %s reported %s(ID:%i) for:\r\n%s\r\n---------------------------------------------------------------------------------------------------------------------\r\n",D,Mo,Y,H,M,S,PlayerName2( playerid ), PlayerName2( params[ 0 ] ), params[ 0 ], params[ 1 ] );
    if (file)
    {
        fwrite(file, STTRR);
        fclose(file);
    }
    return 1;
}
Everybody has PlayerName2.
Reply


Messages In This Thread
How to make a report command. - by Leon_Rahil! - 28.01.2011, 00:55
Re: How to make a report command. - by playbox12 - 28.01.2011, 11:27
Re: How to make a report command. - by Leon_Rahil! - 28.01.2011, 19:42
Re: How to make a report command. - by Mean - 28.01.2011, 21:19
Re: How to make a report command. - by Fool - 29.01.2011, 12:34
Re: How to make a report command. - by Mean - 29.01.2011, 15:24
Re: How to make a report command. - by Max_Coldheart - 30.01.2011, 12:54
Re: How to make a report command. - by Not available - 30.01.2011, 13:13
Re: How to make a report command. - by Zh3r0 - 31.01.2011, 18:33

Forum Jump:


Users browsing this thread: 1 Guest(s)