SA-MP Forums Archive
What is wrong with my code? - 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: What is wrong with my code? (/showthread.php?tid=360305)



What is wrong with my code? - iWhite - 17.07.2012

So, dialog doesn't read \n as new line from file, so i tried, to seperate names and add \n after all of them.

Код:
    new string[64], str[10][26], sat[64];
    new File:example = fopen("Medarb.txt", io_read);
    fread(example, string);
    fclose(example);
    explode(str, string, "\n");
    for(new d; d<10;d++)
    {
       new stor[26];
       format(stor, 26, "%s\n", str[d]);
       strins(sat, stor, 0);
    }
    ShowPlayerDialog(playerid, 899, DIALOG_STYLE_MSGBOX, "Workers", sat, "Ok", "");
It only inputs:

Код:
(New line)
(New line)
(New line)
(New line)
(New line)
(New line)
Barack_Obama\nSteve_Cardinal
In Medarb.txt:

Код:
Barack_Obama\nSteve_Cardinal
Any solutions?


Re: What is wrong with my code? - iWhite - 17.07.2012

Solved...