Convert R7 into R38
#1

hello,
can you please convert this into r38?
pawn Код:
mysql_tquery("SELECT `Username`, `Scores` FROM `players` ORDER BY `Scores` DESC LIMIT 10");
                 mysql_store_result();
                 new ID, output[800];
                 while(mysql_retrieve_row())
                 {
                    ID ++;
                    new username[24], scorevariable[80];
                    cache_get_field_content_int(username, "Username");
                    cache_get_field_content_int(scorevariable, "Scores");
                    format(output, sizeof(output), "%s%d. %s %d Kills\n", output, ID, username, strval(scorevariable));
                 }
                 mysql_free_result();
                 ShowPlayerDialog(playerid, DIALOG_TOPSCORES, DIALOG_STYLE_MSGBOX, "Top 10 Scorer", output, "Ok", "Back");
Reply
#2

Try this:

pawn Код:
mysql_tquery(dbHandle, "SELECT `Username`, `Scores` FROM `players` ORDER BY `Scores` DESC LIMIT 10", "OnSelectFinish", "");

forward OnSelectFinish();
public OnSelectFinish()
{
    new ID, scores, output[800], username[MAX_PLAYER_NAME];
    for(new i = 0; i < cache_get_row_count(); i++)
    {
        ID++;
        cache_get_field_content(i, "Username", username);
        scores = cache_get_field_content_int(i, "Scores");
        format(output, sizeof(output), "%s%d. %s %d Kills\n", output, ID, username, scores);
    }
    ShowPlayerDialog(playerid, DIALOG_TOPSCORES, DIALOG_STYLE_MSGBOX, "Top 10 Scorer", output, "Ok", "Back");
    return 1;
}
Didn't test so there might be bugs.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)