Read from file.
#1

Hey, I want to take all the information from a file, and then to put it in a dialog,
but it will be in lines in the dialog.

How I save the words in the file.
Код:
format(string, sizeof(string), "CRecords/%s.cfg", playername);
new File:filee = fopen(string, io_append);
format(stringg, sizeof(stringg), "%s(%d/%d/%d)\r\n",inputtext, Day, Month,Year);
fwrite(filee, stringg);
fclose(filee);
How it looks in the file:
Код:
First(14/12/2010)
Second(14/12/2010)
And now I want to put it on a dialog:

How I tried to do that:
Код:
new File:filee = fopen(string, io_read);
new stringg[1300];
fread(filee, stringg);
format(string3, sizeof(string3), "Wanted for:\n%s", stringg);
ShowPlayerDialog(playerid,24,DIALOG_STYLE_MSGBOX,"POLICE DATABASE",string3,"Residence","Exit");
fclose(filee);
but it shows me onlt the first line and no all the lines. "First(14/12/2010)"

How can I do that ?
Reply
#2

So basically what you saying is with the first coding it writes 2 times if you type the command or whatever 2 times and for the 2nd coding it only shows 1 when you used it 2 times?
Reply
#3

No,
Listen at the first code it shows you how it saves. and every time it save it saves the text, but you save few times in the file - there's lines. and when I want to see all the text is in the file I see only the first line.

Quote:

And now I want to put it on a dialog:

How I tried to do that:
Код:
new File:filee = fopen(string, io_read);
new stringg[1300];
fread(filee, stringg);
format(string3, sizeof(string3), "Wanted for:\n%s", stringg);
ShowPlayerDialog(playerid,24,DIALOG_STYLE_MSGBOX,"POLICE DATABASE",string3,"Residence","Exit");
fclose(filee);
but it shows me onlt the first line and no all the lines. "First(14/12/2010)"

How can I do that ?

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)