20.10.2016, 13:09
Ey all! I'm trying to make a players TOP, but it doesn't show the rank, I was trying with differents ways but it still with showing the rank..
I'm using this code:
samp-server.exe shows this:
Regards.
PS. Sorry for my bad English, I'm a Spanish guy :v
I'm using this code:
Код:
new string[128], query[256], ranks; new DBResult:result; new DBResult:result2; format(query,sizeof(query),"SELECT `NAME` FROM `USERS` ORDER BY (`RANK` * 1) DESC limit 10"); result = db_query(Database, query); for(new a;a<db_num_rows(result);a++) { db_get_field(result,0,string,128); format(query,sizeof(query),"SELECT `RANK` FROM `USERS` WHERE `NAME` = lower('%s')", string); result2 = db_query(Database,query); ranks = db_get_field_int(result2, 5); new str[40]; format(str, sizeof(str), "%d. %s - Rank: %d", a+1, string, ranks); printf(str); //SendFMessage(playerid, white, "%d. %s - Rank: %d", a+1, string, ranks); db_next_row(result); db_free_result(result2); } db_free_result(result);
Regards.
PS. Sorry for my bad English, I'm a Spanish guy :v