Dialog bug? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dialog bug? (
/showthread.php?tid=360096)
Dialog bug? -
iWhite - 16.07.2012
With fread, whole file should be readed. Well, it is, but I have some problems.
Text in file:
Код:
Patrick\nPat\nPotatoman
My code:
Код:
new string[64];
new File:example = fopen("File.txt", io_read);
fread(example, string);
fclose(example);
ShowPlayerDialog(playerid, 899, DIALOG_STYLE_MSGBOX, "Names", string, "Ok", ""); // Print what was read
But it outputs
Код:
Patrick\nPat\nPotatoman
without new lines...
Any solutions?
Re: Dialog bug? -
iWhite - 16.07.2012
"\n" are typed in too...
Re: Dialog bug? -
Christopher - 16.07.2012
Bias on how you saved "File.txt" when you read the file the ASCII character won't read as line breaks. Your best bet is to parse the file yourself to include the line breaks in the dialog output yourself as an amendment to the string.
Re: Dialog bug? -
iWhite - 16.07.2012
Quote:
Originally Posted by Bitrate
Bias on how you saved "File.txt" when you read the file the ASCII character won't read as line breaks. Your best bet is to parse the file yourself to include the line breaks in the dialog output yourself as an amendment to the string.
|
You mean to put String defined by fread to another string?
Re: Dialog bug? -
iWhite - 16.07.2012
Still no solution...
Respuesta: Dialog bug? -
sicol - 11.10.2012
change \n for \r\n