if(!Top10Block[2]){
Top10Block[2] = true;
SetTimerEx("Top10Unlock",300000,0,"i",2);
strdel(Top10Text[2],0,512);
for(new x=0;x<10;x++){
new str[128];
new name[25];
new score[11];
format(str,sizeof(str),"SELECT Nick,Drag FROM Players ORDER BY `Drag` ASC, `Nick` ASC LIMIT %d , %d",x,x+1);
mysql_query(str);
mysql_store_result(MySQLcon);
mysql_fetch_row_format(str, "|",MySQLcon);
new ii=strlen(str);
for(new i=0;i<ii;i++){
if(strfind(str[i],"|",false)==0){
strmid(name,str,0,i);
strmid(score,str,i+1,ii);
break;
}
}
mysql_free_result(MySQLcon);
new Ms = strval(score);
format(score, sizeof(score), "%d:%03d",Ms/1000,Ms-((Ms/1000)*1000));
format(Top10Text[2],512,"%s\n%d. %25s %11s",Top10Text[2],x+1,name,score);
}
}
ShowPlayerDialog(playerid,21,0,"Drag TOP-10:",Top10Text[2],"Cofnij","Wyjscie");