01.05.2019, 00:14
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.
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;
}

