Dialog with loop.
#1

****
Reply
#2

That's not how it is supposed to be done. What you currently do is try to show the player 5 dialogs, but you only want to show ONE dialog.

You first need to create a buffer that will store the dialog content, then format it with the loop's help and then display the dialog (once).

pawn Код:
new buffer[512], string[128];
for(new i = 0; i != 5; i++)
{
    format(string, sizeof(string), "%s - %s\n", Uuendused[i][uuendus], Uuendused[i][staatus]);
    strcat(buffer, string); // append the formatted string to the buffer
}
// Proceed with ShowPlayerDialog
Some people like to do it like this:
pawn Код:
format(buffer, sizeof(buffer), %s%s - %s\n", buffer, Uuendused[i][uuendus], Uuendused[i][staatus]);
But this is not a very fast solution once your strings grow bigger!

Good luck!
Reply
#3

****
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)