Save what player has typed
#3

Quote:
Originally Posted by Abreezy
Посмотреть сообщение
I don't fully understand your problem/help request. What i think you said is, you want to see what a player types?
What don't you understand ? He's asking how to save what players typed as their answer and whatever they typed get saved to a notepad file (or some other editable text file).

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

pawn Код:
foldername/logs/
to where you want your logs/typed log to save to. You must create the custom file in scriptfiles, so it should be something like ...

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.
Reply


Messages In This Thread
Save what player has typed - by FreeSoul - 28.08.2011, 22:13
Re: Save what player has typed - by Abreezy - 28.08.2011, 23:27
Re: Save what player has typed - by grand.Theft.Otto - 28.08.2011, 23:44
Re: Save what player has typed - by LetsOWN[PL] - 29.08.2011, 01:30
Re: Save what player has typed - by grand.Theft.Otto - 29.08.2011, 01:52
Re: Save what player has typed - by Improvement™ - 29.08.2011, 05:57
Re: Save what player has typed - by FreeSoul - 29.08.2011, 09:42
Re: Save what player has typed - by Babul - 29.08.2011, 11:13

Forum Jump:


Users browsing this thread: 2 Guest(s)