if(dialogid == D_Tops) 
    {
        if(response)
         {
            switch(listitem) {
                case 0: {
                    new cQuery[1024];
                    format(cQuery, sizeof(cQuery), "SELECT Name, Level, Color FROM `players` ORDER BY `Level` DESC LIMIT 10");
                    mysql_query(MySQL, cQuery);
                    mysql_store_result();
                    new num, top[10][24], score[10][10], Top[1024], color[10][10];
                    while(mysql_retrieve_row())
                    {
                        mysql_fetch_field_row(top[num], "Name");
                          mysql_fetch_field_row(score[num], "Level");
                          mysql_fetch_field_row(color[num], "Color");
                        num ++;
                    }
                    format(Top, sizeof(Top),"Top\tNickname\tLevel\n1\t{%06x}%s\t%i\n2\t{%06x}%s\t%i\n3\t{%06x}%s\t%i\n4\t{%06x}%s\t%i\n5\t{%06x}%s\t%i\n6\t{%06x}%s\t%i\n7\t{%06x}%s\t%i\n8\t{%06x}%s\t%i\n9\t{%06x}%s\t%i\n10\t{%06x}%s\t%i",
                        strval(color[0]) >>> 8, top[0], strval(score[0]),
                        strval(color[1]) >>> 8, top[1], strval(score[1]),
                        strval(color[2]) >>> 8, top[2], strval(score[2]),
                        strval(color[3]) >>> 8, top[3], strval(score[3]),
                        strval(color[4]) >>> 8, top[4], strval(score[4]),
                        strval(color[5]) >>> 8, top[5], strval(score[5]),
                        strval(color[6]) >>> 8, top[6], strval(score[6]),
                        strval(color[7]) >>> 8, top[7], strval(score[7]),
                        strval(color[8]) >>> 8, top[8], strval(score[8]),
                        strval(color[9]) >>> 8, top[9], strval(score[9])
                    );
                    ShowPlayerDialog(playerid, D_Tops+1, DIALOG_STYLE_TABLIST_HEADERS, "Top Level", Top, "Close", "Back");
                    mysql_free_result();
                }
                case 1: {
                    new cQuery[1024];
                    format(cQuery, sizeof(cQuery), "SELECT Name, Kills, Color FROM `players` ORDER BY `Kills` DESC LIMIT 10");
                    mysql_query(MySQL, cQuery);
                    mysql_store_result();
                    new num, top[10][24], score[10][10], Top[1024], color[10][10];
                    while(mysql_retrieve_row())
                    {
                        mysql_fetch_field_row(top[num], "Name");
                          mysql_fetch_field_row(score[num], "Kills");
                          mysql_fetch_field_row(color[num], "Color");
                        num ++;
                    }
                    format(Top, sizeof(Top),"Top\tNickname\tKills\n1\t{%06x}%s\t%i\n2\t{%06x}%s\t%i\n3\t{%06x}%s\t%i\n4\t{%06x}%s\t%i\n5\t{%06x}%s\t%i\n6\t{%06x}%s\t%i\n7\t{%06x}%s\t%i\n8\t{%06x}%s\t%i\n9\t{%06x}%s\t%i\n10\t{%06x}%s\t%i",
                        strval(color[0]) >>> 8, top[0], strval(score[0]),
                        strval(color[1]) >>> 8, top[1], strval(score[1]),
                        strval(color[2]) >>> 8, top[2], strval(score[2]),
                        strval(color[3]) >>> 8, top[3], strval(score[3]),
                        strval(color[4]) >>> 8, top[4], strval(score[4]),
                        strval(color[5]) >>> 8, top[5], strval(score[5]),
                        strval(color[6]) >>> 8, top[6], strval(score[6]),
                        strval(color[7]) >>> 8, top[7], strval(score[7]),
                        strval(color[8]) >>> 8, top[8], strval(score[8]),
                        strval(color[9]) >>> 8, top[9], strval(score[9])
                    );
                    ShowPlayerDialog(playerid, D_Tops+2, DIALOG_STYLE_TABLIST_HEADERS, "Top Killers", Top, "Close", "Back");
                    mysql_free_result();
                }
                case 2: {
                    new cQuery[1024];
                    format(cQuery, sizeof(cQuery), "SELECT Name, Deaths, Color FROM `players` ORDER BY `Deaths` DESC LIMIT 10");
                    mysql_query(MySQL, cQuery);
                    mysql_store_result();
                    new num, top[10][24], score[10][10], Top[1024], color[10][10];
                    while(mysql_retrieve_row())
                    {
                        mysql_fetch_field_row(top[num], "Name");
                        mysql_fetch_field_row(score[num], "Deaths");
                        mysql_fetch_field_row(color[num], "Color");
                        num ++;
                    }
                    format(Top, sizeof(Top),"Top\tNickname\tDeaths\n1\t{%06x}%s\t%i\n2\t{%06x}%s\t%i\n3\t{%06x}%s\t%i\n4\t{%06x}%s\t%i\n5\t{%06x}%s\t%i\n6\t{%06x}%s\t%i\n7\t{%06x}%s\t%i\n8\t{%06x}%s\t%i\n9\t{%06x}%s\t%i\n10\t{%06x}%s\t%i",
                        strval(color[0]) >>> 8, top[0], strval(score[0]),
                        strval(color[1]) >>> 8, top[1], strval(score[1]),
                        strval(color[2]) >>> 8, top[2], strval(score[2]),
                        strval(color[3]) >>> 8, top[3], strval(score[3]),
                        strval(color[4]) >>> 8, top[4], strval(score[4]),
                        strval(color[5]) >>> 8, top[5], strval(score[5]),
                        strval(color[6]) >>> 8, top[6], strval(score[6]),
                        strval(color[7]) >>> 8, top[7], strval(score[7]),
                        strval(color[8]) >>> 8, top[8], strval(score[8]),
                        strval(color[9]) >>> 8, top[9], strval(score[9])
                    );
                    ShowPlayerDialog(playerid, D_Tops+3, DIALOG_STYLE_TABLIST_HEADERS, "Top Noobs", Top, "Close", "Back");
                    mysql_free_result();
                }
                case 3: {
                    new cQuery[1024];
                    format(cQuery, sizeof(cQuery), "SELECT Name, Ratio, Color FROM `players` ORDER BY `Ratio` DESC LIMIT 10");
                    mysql_query(MySQL, cQuery);
                    mysql_store_result();
                    new num, top[10][24], score[10][10], Top[1024], color[10][10];
                    while(mysql_retrieve_row())
                    {
                        mysql_fetch_field_row(top[num], "Name");
                        mysql_fetch_field_row(score[num], "Ratio");
                        mysql_fetch_field_row(color[num], "Color");
                        num ++;
                    }
                    format(Top, sizeof(Top),"Top\tNickname\tRatio\n1\t{%06x}%s\t%0.2f\n2\t{%06x}%s\t%0.2f\n3\t{%06x}%s\t%0.2f\n4\t{%06x}%s\t%0.2f\n5\t{%06x}%s\t%0.2f\n6\t{%06x}%s\t%0.2f\n7\t{%06x}%s\t%0.2f\n8\t{%06x}%s\t%0.2f\n9\t{%06x}%s\t%0.2f\n10\t{%06x}%s\t%0.2f",
                        strval(color[0]) >>> 8, top[0], floatstr(score[0]),
                        strval(color[1]) >>> 8, top[1], floatstr(score[1]),
                        strval(color[2]) >>> 8, top[2], floatstr(score[2]),
                        strval(color[3]) >>> 8, top[3], floatstr(score[3]),
                        strval(color[4]) >>> 8, top[4], floatstr(score[4]),
                        strval(color[5]) >>> 8, top[5], floatstr(score[5]),
                        strval(color[6]) >>> 8, top[6], floatstr(score[6]),
                        strval(color[7]) >>> 8, top[7], floatstr(score[7]),
                        strval(color[8]) >>> 8, top[8], floatstr(score[8]),
                        strval(color[9]) >>> 8, top[9], floatstr(score[9])
                    );
                    ShowPlayerDialog(playerid, D_Tops+4, DIALOG_STYLE_TABLIST_HEADERS, "Top Ratios", Top, "Close", "Back");
                    mysql_free_result();
                }
                case 4:
                {
                    new cQuery[1024];
                    format(cQuery, sizeof(cQuery), "SELECT Name, Weed, Color FROM `players` ORDER BY `Weed` DESC LIMIT 10");
                    mysql_query(MySQL, cQuery);
                    mysql_store_result();
                    new num, top[10][24], score[10][10], Top[1024], color[10][10];
                    while(mysql_retrieve_row())
                    {
                        mysql_fetch_field_row(top[num], "Name");
                        mysql_fetch_field_row(score[num], "Weed");
                        mysql_fetch_field_row(color[num], "Color");
                        num ++;
                    }
                    format(Top, sizeof(Top),"Top\tNickname\tWeed Grams\n1\t{%06x}%s\t%i\n2\t{%06x}%s\t%i\n3\t{%06x}%s\t%i\n4\t{%06x}%s\t%i\n5\t{%06x}%s\t%i\n6\t{%06x}%s\t%i\n7\t{%06x}%s\t%i\n8\t{%06x}%s\t%i\n9\t{%06x}%s\t%i\n10\t{%06x}%s\t%i",
                        strval(color[0]) >>> 8, top[0], strval(score[0]),
                        strval(color[1]) >>> 8, top[1], strval(score[1]),
                        strval(color[2]) >>> 8, top[2], strval(score[2]),
                        strval(color[3]) >>> 8, top[3], strval(score[3]),
                        strval(color[4]) >>> 8, top[4], strval(score[4]),
                        strval(color[5]) >>> 8, top[5], strval(score[5]),
                        strval(color[6]) >>> 8, top[6], strval(score[6]),
                        strval(color[7]) >>> 8, top[7], strval(score[7]),
                        strval(color[8]) >>> 8, top[8], strval(score[8]),
                        strval(color[9]) >>> 8, top[9], strval(score[9])
                    );
                    ShowPlayerDialog(playerid, D_Tops+4, DIALOG_STYLE_TABLIST_HEADERS, "Top Smokers", Top, "Close", "Back");
                    mysql_free_result();
                }
            }
        }
    }