/Toprich command help sqlite
#7

Quote:
Originally Posted by UFF
Посмотреть сообщение
Код:
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 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)); 
    	ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Top Rich List", str , "Exit", "");
    	db_next_row(result);
	}
Thanks for the reply bro, but this won't work because 'ShowPlayerDialog' is inside the loop, Therefore it will repeat 10 times(actually we can't see it's very fast and only the 10th one we can see because it stops from 10)

Then the result will be like this
Код:
10. GameOvr - Kills; 5 (Only shows the last one because it is 10th dialog)
If some one knows how to do this please reply
I was waiting for a long time
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: 3 Guest(s)