02.10.2018, 15:11
You need to concatenate the strings. One way is `strcat`:
every time it formats the text, it joins it with the rest and you show the dialog after the loop with `str`.
Another way is to re-format but it is slower if the string gets longer in length.
Again you are showing the last row.
pawn Код:
// example:
format(part_of, sizeof part_of, "...", ...);
strcat(str, part_of);
Another way is to re-format but it is slower if the string gets longer in length.
pawn Код:
// example:
format(str, sizeof str, "%s...", str, ...);
Quote:
oh my mistake
Код:
new str[200], name[MAX_PLAYER_NAME], DBResult: result = db_query(db_open("Top.db"), "SELECT `Name`,`Kills` FROM `Players` ORDER BY `Kills` DESC limit 0,10"); for (new a, rows = db_num_rows(result); a < rows; a++) { db_get_field(result, 0, name, sizeof(name)); format(str, sizeof(str), "%d. %s - Kills: %d\n", a + 1, name, db_get_field_int(result, 1)); db_next_row(result); } ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Top Rich List", str , "Exit", ""); |