MySQL BlueGR38 - 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 BlueGR38 (
/showthread.php?tid=504823)
MySQL BlueGR38 -
Mriss - 05.04.2014
Could someone help me make a cmd that shows the top players? top 5
in MySQL BlueGR38
My ConnectionHandle:
MysqlCon
Re : MySQL BlueGR38 -
MCZOFT - 05.04.2014
Link it in a command ,
ex: cmd:top5
and link it
PHP код:
mysql_query("SELECT username, score FROM `table` ORDER BY `score` DESC LIMIT 5");
mysql_store_result();
new num, top[5][24], score[5][5];
while(mysql_retrieve_row())
{
mysql_fetch_field_row(top[num], "username");
mysql_fetch_field_row(score[num], "score");
num++;
}
mysql_free_result();
printf("Rank 1: %s, Rank 2: %s, Rank 3: %s, Rank 4: %s, Rank 5: %s", top[0], top[1], top[2], top[3], top[4], top[5]);
Good luck
Re: MySQL BlueGR38 -
Mriss - 05.04.2014
thx vry much
Re: MySQL BlueGR38 -
Mriss - 05.04.2014
Код:
C:\Users\Bradley\Desktop\SA-MP\gamemodes\cnr.pwn(3500) : error 017: undefined symbol "mysql_store_result"
C:\Users\Bradley\Desktop\SA-MP\gamemodes\cnr.pwn(3502) : error 017: undefined symbol "mysql_retrieve_row"
C:\Users\Bradley\Desktop\SA-MP\gamemodes\cnr.pwn(3504) : error 017: undefined symbol "mysql_fetch_field_row"
C:\Users\Bradley\Desktop\SA-MP\gamemodes\cnr.pwn(3505) : error 017: undefined symbol "mysql_fetch_field_row"
C:\Users\Bradley\Desktop\SA-MP\gamemodes\cnr.pwn(3508) : error 017: undefined symbol "mysql_free_result"
C:\Users\Bradley\Desktop\SA-MP\gamemodes\cnr.pwn(3509) : error 032: array index out of bounds (variable "top")
...Its supposed to be MySQL BueG r38
Re: MySQL BlueGR38 -
Mriss - 06.04.2014
So noone has one?
Re: MySQL BlueGR38 -
VishvaJeet - 06.04.2014
Код:
SELECT row_name FROM table_name ORDER BY row_name DESC LIMIT 5
Re: MySQL BlueGR38 -
Dubya - 06.04.2014
pawn Код:
mysql_tquery(conhandle, "SELECT username, score FROM `table` ORDER BY `score` DESC LIMIT 5", "OnTop5Show", "i", playerid);
public OnTop5Show(playerid) {
new rows, fields;
cache_get_data(rows, fields);
new top[rows][24], score[rows][5]
for(new i=0;i<rows;i++) {
cache_get_row(i, 0, top[i]);
cache_get_row(i, 1, score[i]);
}
printf("Rank 1: %s, Rank 2: %s, Rank 3: %s, Rank 4: %s, Rank 5: %s", top[0], top[1], top[2], top[3], top[4], top[5]);
}