SA-MP Forums Archive
MySQL Toplist - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL Toplist (/showthread.php?tid=512402)



MySQL Toplist - Nils94 - 10.05.2014

Solved.


Re: MySQL Toplist - Konstantinos - 10.05.2014

I'll assume the field for the name is 1. Just be sure you use LIMIT 3 in the query so it won't exceed in temp_Name array.
pawn Code:
new rows = cache_num_rows(), string[100], temp_Name[3][MAX_PLAYER_NAME] = {"N/A", "N/A", "N/A"};
for (new j; j != rows; ++j) cache_get_row(j, 1, temp_Name[j]);
format(string, sizeof (string), "\n\n\n\nP 1: %s\nP 2: %s\nP 3: %s", temp_Name[0], temp_Name[1], temp_Name[2]);