Dialog scripting
#2

First, add this anywhere in the script:
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;
}
And then:
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","");
    }
}
Should work. Saves in "scriptfiles\Logs\reglog.txt".
Reply


Messages In This Thread
Dialog scripting - by Skank - 20.09.2011, 09:34
Re: Dialog scripting - by Mean - 20.09.2011, 09:53
Re: Dialog scripting - by Skank - 20.09.2011, 10:04
Re: Dialog scripting - by Skank - 20.09.2011, 10:16
Re: Dialog scripting - by aRoach - 20.09.2011, 10:32
Re: Dialog scripting - by Skank - 20.09.2011, 10:47
Re: Dialog scripting - by aRoach - 20.09.2011, 10:57

Forum Jump:


Users browsing this thread: 1 Guest(s)