How do I make a dialog MSGBOX which shows multiple lines from fread?
#1

So I have a command that I'm trying to make which takes lines from fread() and I want to make it so that each line found shows up in its own separate line in a dialog.

Here is what I have so far but the problem with it right now is it only shows the last line... I want the dialog box to show ALL the results in its own line... if that makes any sense.


Код:
CMD:viewfeedback(playerid, params[])
{
	new File:handle = fopen("feedback.txt", io_read);

	if(handle)
	{
		new line[128];
		new i = 1;
		while(fread(handle, line)) 
		{
			new dialoglines[250], dialogstring[1000];
			format(dialoglines, sizeof(dialoglines), "[%i] %s\n", i, line);
			strcat(dialogstring, dialoglines);
			ShowPlayerDialog(playerid, 89273, DIALOG_STYLE_MSGBOX, "View Feedback", dialogstring, "Close", "");
			i++;
		}
		fclose(handle);

	}
	else SendClientMessage (playerid, -1, "error");
	return 1;

}
Reply


Messages In This Thread
How do I make a dialog MSGBOX which shows multiple lines from fread? - by aKnoxx - 01.05.2019, 00:14
Re: How do I make a dialog MSGBOX which shows multiple lines from fread? - by BsLOUAY - 01.05.2019, 00:24
Re: How do I make a dialog MSGBOX which shows multiple lines from fread? - by aKnoxx - 01.05.2019, 00:27

Forum Jump:


Users browsing this thread: 1 Guest(s)