/Toprich command help sqlite
#9

You need to concatenate the strings. One way is `strcat`:
pawn Код:
// example:
format(part_of, sizeof part_of, "...", ...);
strcat(str, part_of);
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.
pawn Код:
// example:
format(str, sizeof str, "%s...", str, ...);
Quote:
Originally Posted by UFF
Посмотреть сообщение
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", "");
try this!
Again you are showing the last row.
Reply


Messages In This Thread
/Toprich command help sqlite - by GameOvr - 01.10.2018, 11:18
Re: /Toprich command help sqlite - by DAKYSKYE - 01.10.2018, 20:22
Re: /Toprich command help sqlite - by Calisthenics - 01.10.2018, 20:56
Re: /Toprich command help sqlite - by GameOvr - 01.10.2018, 21:39
Re: /Toprich command help sqlite - by GameOvr - 02.10.2018, 08:42
Re: /Toprich command help sqlite - by UFF - 02.10.2018, 08:48
Re: /Toprich command help sqlite - by GameOvr - 02.10.2018, 13:35
Re: /Toprich command help sqlite - by UFF - 02.10.2018, 13:47
Re: /Toprich command help sqlite - by Calisthenics - 02.10.2018, 15:11
Re: /Toprich command help sqlite - by GameOvr - 03.10.2018, 02:50
Re: /Toprich command help sqlite - by GameOvr - 03.10.2018, 10:20

Forum Jump:


Users browsing this thread: 2 Guest(s)