28.08.2011, 23:44
Quote:
I don't fully understand your problem/help request. What i think you said is, you want to see what a player types?
|
Add this to the bottom of the script:
pawn Код:
forward SaveToFile(filename[],text[]);
public SaveToFile(filename[],text[])
{
#if defined SAVE_LOGS
new File:file, filepath[256], string[256], year,month,day, hour,minute,second;
getdate(year,month,day); gettime(hour,minute,second);
format(filepath,sizeof(filepath),"foldername/logs/%s.txt",filename);
file = fopen(filepath,io_append);
format(string,sizeof(string),"[%d.%d.%d %d:%d:%d] %s\r\n",day,month,year,hour,minute,second,text);
fwrite(file,string);
fclose(file);
#endif
return 1;
}
pawn Код:
foldername/logs/
ServerDirectory/scriptfiles/TypedLog.txt
When the notepad file (TypedLog) is created, the script will find this file when we use our custom SaveToFile function.
Under where the player types the questions, use SaveToFile("TypedLog",string); assuming string is what is being used to format your text when they type and TypedLog as the name of your notepad file.