/report command
#1

I have a /report command that works perfect but....




How can i take my report command but make it so that the reports get saved into a .txt document. So then admin can type /checkreports and it shows the reports?



Also, How can I make it so the reports get removed by themselves in a couple of minutes from the .txt file?
Reply
#2

I think you should check some admin scripts out, because this will help more than anything and certainly more than me posting a code here.
But here is an eg from Lux Admin (credits to luxurion )
Код:
forward SaveIn(filename[],text[]);

public SaveIn(filename[],text[])
{
       new File:Lfile;
	new filepath[256];
	new string[256];
	new year,month,day;
	new hour,minute,second;
	
	getdate(year,month,day);
	gettime(hour,minute,second);
	format(filepath,sizeof(filepath),"Logs/Reports/%s.txt",filename);
	Lfile = fopen(filepath,io_append);
	format(string,sizeof(string),"[%02d/%02d/%02d | %02d:%02d:%02d] %s\r\n",day,month,year,hour,minute,second,text);
	fwrite(Lfile,string);
	fclose(Lfile);
	return 1;
}
Then you would save something like this:
Under your report command:
Код:
format(str, sizeof(str), "REPORT: %s(Id:%d) Reported %s(Id:%d) Reason: %s |Time: %d:%d:%d|", reporter,playerid, reportedname, reported, params[strlen(tmp)+1], hour,minute,second);
SaveIn("ReportLog",str);
Reply
#3

Quote:
Originally Posted by DJDhan
I think you should check some admin scripts out, because this will help more than anything and certainly more than me posting a code here.
I have searched through a bunch of scripts, and none of them have what i need. Do you know one?
Reply
#4

Read up again .. He showed you an code of what you wanted as he said "LUX ADMIN"
Reply
#5

thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)