11.07.2015, 21:29
need top 10 rank mysql
mysql version r39-2
+rep
mysql version r39-2
+rep
mysql_tquery( mysql, "SELECT username, rank FROM `your database` ORDER BY `rank` DESC LIMIT 20", "LoadTopRank", "", "" );
forward LoadTopRank( );
public LoadTopRank( )
{
new
name[24], rank, str[ 512 ];
for(new i =0; i < cache_num_rows(); i++)
{
cache_get_field_content(i, "username", name, mysql, 24);
kills = cache_get_field_content_int(i,"rank");
deaths = cache_get_field_content_int(i,"deaths");
format( str, sizeof( str ) , "%s %i) %s %i", str, i+1, name, rank);
}
ShowPlayerDialog( playerid, 2121, DIALOG_STYLE_MSGBOX,"Top",str, "Close","" );
}