showing results from files into dialog
#1

I'm having a little problem with this code;
pawn Код:
if(fexist("names.txt"))
    {
        new File:pname = fopen("names.txt");
        new str[128];
        new string[400];
        while(fread(pname, string))
        {
            format(str,sizeof(str), "%s\n", string);
            printf("%s", str);
            ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Players", str, "Ok", "Cancel");
        }
        fclose(pname);
    }
And here's names.txt
Код:
player1
player2
player3
player4
It prints everything perfectly. But it only shows player4 in the dialog.
Reply


Messages In This Thread
showing results from files into dialog - by newbienoob - 06.03.2014, 05:30
Re: showing results from files into dialog - by ]Rafaellos[ - 06.03.2014, 05:32
Re: showing results from files into dialog - by newbienoob - 06.03.2014, 05:38
Re: showing results from files into dialog - by ]Rafaellos[ - 06.03.2014, 05:41
Re: showing results from files into dialog - by newbienoob - 06.03.2014, 05:44
Re: showing results from files into dialog - by ]Rafaellos[ - 06.03.2014, 05:46
Re: showing results from files into dialog - by newbienoob - 06.03.2014, 05:51

Forum Jump:


Users browsing this thread: 3 Guest(s)