20.09.2011, 09:53
First, add this anywhere in the script:
And then:
Should work. Saves in "scriptfiles\Logs\reglog.txt".
pawn Код:
// "stolen" from LuxAdmin:
stock 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/%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;
}
pawn Код:
if(dialogid == 12347) {
if(response) {
new regstring[128];
new regname[64];
GetPlayerName(playerid,regname,sizeof(regname));
format(regstring,sizeof(regstring),"%s. Du hast dich erfolgreich registriert",regname);
SaveIn( "reglog.txt", regstring );
ShowPlayerDialog(playerid,12349,DIALOG_STYLE_INPUT,"{0080C0}Highness RolePlay","How did you find us?","Next","");
}
}