This is the code plz help
Code:
ShowTopClan( playerid, stats[ ], what[ ], limit = MAX_TOP_LIMIT ) //
{
#pragma unused what
//--------------------------------------------------------------------------
new Speed = GetTickCount(), DialString[3_000], String[2][256], Query[2][256],
DBResult:Result1, cColor[12] = "{00BBF6}", oColor[12] = "{FF9900}";
//--------------------------------------------------------------------------
Database = db_open( "ClanesJokers98.db" ); //Base de datos DB
//--------------------------------------------------------------------------
format( Query[ 0 ], 256, "SELECT `clanname` FROM `clans` ORDER BY (`%s` * 1) DESC limit %d", stats, limit);
Result1 = db_query( Database, Query[ 0 ] );
//--------------------------------------------------------------------------
format( DialString, sizeof DialString, "%s For more information about the {00FFFF} Clan System {FF9900}Usa: {FF0000}/infoclan\n",oColor);
for( new Qr; Qr < db_num_rows( Result1 ); Qr ++ )
{
db_get_field( Result1, 0, String[ 0 ], 256 );
format( Query[ 1 ], 256, "SELECT `%s` FROM `clans` WHERE `clanname` = '%s'", stats, String[ 0 ] );
new DBResult:Result2 = db_query( Database, Query[ 1 ] );
db_get_field( Result2, 0, String[ 1 ], 256 );
format( DialString, sizeof DialString, "%s\n{00BFFF}%d.{FF0000} %s {00FF00}Clan Kills: %s%s {FF0000}(Members: %d)", DialString, Qr + 1, String[0], cColor, FormatNumber(strval(String[1])), GetTotalMembers(String[0]));
db_next_row( Result1 );
db_free_result( Result2 );
}
db_free_result( Result1 );
format( DialString, sizeof DialString, "%s\n\n{FF9900}Top lista general en {FF0000}%d{FF9900} ms.", DialString, GetTickCount( ) - Speed );
ShowPlayerDialog( playerid, Nothing, DIALOG_STYLE_MSGBOX, " {FF0000}-{00FF00} Top Clanes", DialString, "Ok", "" );
return 1;
}