01.10.2018, 21:39
Quote:
First of all you need to have column for cash in Players table. In this example, I will use cash as an column of value of cash.
So, here it is, but notice that: I don't use easy sqlite and am in a hurry, so take this code and do the same with easy sqlite. PHP код:
|
Quote:
The include does not provide ORDER BY clause and there is lack of documentation too. It is more complex than using default sa-mp natives and get the job done.
MAX returns the highest value on cash, you need to select the columns you want (name, cash) and order it by highest (DESC). If you search "samp sqlite top 10", you can find many threads. |
Код:
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", a + 1, name, db_get_field_int(result, 1)); SendClientMessage(playerid, -1, str); db_next_row(result); }
but if I put that inside loop dialog will repeat
so can anyone tell me how to do that Thanks again