31.01.2011, 18:33
This is rather simplier.
Everybody has PlayerName2.
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;
}