Can anyone make me this message into dialog??? [HELP]
#1

topic solved
Reply
#2

Not sure but change SendClientMessage to

Код:
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Score",szMessage,"Ok","Exit");
Oh and change this:

Код:
format(szMessage, sizeof(szMessage), "%d. %s - %d score", i, playerName, playerScore);
To this:
Код:
format(szMessage, sizeof(szMessage), "%d. %s - %d score\n", i, playerName, playerScore);
Reply
#3

....
Reply
#4

Add this:
Код:
new szMessages[64];
Change this:
Код:
format(szMessage, sizeof(szMessage), "%d. %s - %d score", i, playerName, playerScore);
To
Код:
format(szMessages, sizeof(szMessages), "%d. %s - %d score\n", i, playerName, playerScore);
strcat(szMessage,szMessages);
And you might want to make szMessage bigger [64] is not big enough.
Reply
#5

pawn Код:
CMD:top10(playerid, params[]) {
new Query[789];
    format(Query, sizeof(Query), "SELECT `PlayerName`, `Kills` FROM `Account` WHERE `Kills` > 0 ORDER BY `Kills` DESC LIMIT 10");
    if(mysql_ping(gSQL))
    {
        mysql_query(Query, _THREAD_TOP_KILLER, playerid, gSQL);
    }
    mysql_store_result();
    if(mysql_num_rows() > 0) {
        new
            playerName[MAX_PLAYER_NAME],
            playerScore[128],
            i = 1,
            szMessage[64],
            dialog_Body[640],
            szReturn[64];

        while(mysql_fetch_row(szReturn)) {
            sscanf(szReturn, "p<|>sd", playerName, playerScore);
            format(szMessage, sizeof(szMessage), "\n%d. %s - %d score", i, playerName, playerScore);
            strcat(dialog_Body, szMessage);
            i++;
        }
        ShowPlayerDialog(playerid, 5012, DIALOG_STYLE_LIST, "Top Killers", dialog_Body, "OK", "");
        return mysql_free_result();
    }

    return 1;
}
By the way, your code looks complicated. Try improving the script to threaded queries.
Reply
#6

....
Reply
#7

Are you sure it shows the top killers correctly when it's just a client message?
Reply
#8

....
Reply
#9

....
Reply
#10

Quote:
Originally Posted by ShivRp
Посмотреть сообщение
Its already threaded, but idk how to use them ((((
mysql ping _thread_something idk
i'm new to Mysql and was better with R6 ,,
recently updated to r7 thats y

This was your result!

Thank you very much +repped!
Moderators can now /lock the topic!
You can download the latest version of BlueG's plugin since it became really easy to use threaded queries - it also has tutorials and wiki page on the plugin topic.

You are welcome.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)