26.04.2012, 12:53
hey
or this code is good ? And he works ?
Код:
CMD:top10(playerid,params[]) { new msg[550], patirt[10], pinig[10], Zaidejas[MAX_PLAYER_NAME], query[500]; new vieta = 0; format(query,sizeof(query),"SELECT * FROM `players` ORDER BY `Patirtis` LIMIT 10"); format(query,sizeof(query),"SELECT * FROM `players` ORDER BY `Pinigai` LIMIT 10"); mysql_query(query); mysql_store_result(); while(mysql_fetch_row(query)) { vieta ++; mysql_get_field("Vardas", Zaidejas); mysql_get_field("Patirtis", patirt); mysql_get_field("Pinigai", pinig); format(msg,sizeof(msg),"%s{FFFFFF}%d %s patirtis: {FF94B8}%d\r\n", msg, vieta, Zaidejas, patirt); format(msg,sizeof(msg),"%s{FFFFFF}%d %s pinigai: {FF94B8}%d\r\n", msg, vieta, Zaidejas, pinig); } ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Top 10",msg, "", "Uћdaryti"); mysql_free_result(); return 1; }