Output ini file to a list dialog - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Output ini file to a list dialog (
/showthread.php?tid=257059)
Output ini file to a list dialog -
orrgoren11 - 23.05.2011
Hello!
O.K - I have *.ini file that contains, for example:
Code:
first,
second,
third,
or
I can do either ways.
How can I output this list, to a dialog list?
Thank you very much!
Re: Output ini file to a list dialog -
Seven_of_Nine - 23.05.2011
pawn Code:
new text[128],dialog[128];
new File:file = fopen("filehere.ini",io_read);
while(fread(file,text)) {
if(!strlen(text)) continue;
format(text,sizeof(text),"%s\n",text);
strcat(dialog,text);
}
ShowPlayerDialog(playerid,dialogid,YOUR_DIALOG_STYLE,"Caption",dialog,"Button 1","Button 2");
Untested.
Re: Output ini file to a list dialog -
orrgoren11 - 23.05.2011
I'll check and return & answer.
Edit: Diaplaying nothing.
Second Edit: By bad. works great! thank you very much.