SA-MP Forums Archive
Can anyone make me this message into dialog??? [HELP] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Can anyone make me this message into dialog??? [HELP] (/showthread.php?tid=501127)



.... - Guest4390857394857 - 16.03.2014

topic solved


Re: Can anyone make me this message into dialog??? [HELP] - mirou123 - 16.03.2014

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);



.... - Guest4390857394857 - 16.03.2014

....


Re: Can anyone make me this message into dialog??? [HELP] - mirou123 - 16.03.2014

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.


Re: Can anyone make me this message into dialog??? [HELP] - Calabresi - 16.03.2014

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.


.... - Guest4390857394857 - 16.03.2014

....


Re: Can anyone make me this message into dialog??? [HELP] - mirou123 - 16.03.2014

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


.... - Guest4390857394857 - 16.03.2014

....


.... - Guest4390857394857 - 16.03.2014

....


Re: Can anyone make me this message into dialog??? [HELP] - Calabresi - 16.03.2014

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.