Stats in dialog help
#2

pawn Code:
CMD:stats(playerid, params[])
{
    if(!PlayerAcc[playerid][Log]) return SendClientMessage(playerid, COLOR_ORANGE, "You are not logged in, please login first.");
    new coordsstring[290], statsstring[144], h, m, s, admin = PlayerAcc[playerid][Admin],
    warn = PlayerAcc[playerid][Warn], skin = PlayerAcc[playerid][SaveSkin],
    score = GetPlayerScore(playerid), money = GetPlayerMoney(playerid), arank[18],
    kill = PlayerAcc[playerid][Kills], death = PlayerAcc[playerid][Deaths];
    TotalGameTime(playerid, h, m, s);
    switch(admin)
    {
        case 3: arank = "Tester";
        case 4: arank = "CO Moderator";
        case 5: arank = "Moderator";
        case 6: arank = "CO Administrator";
        case 7: arank = "Administrator";
        case 8: arank = "Head Admin";
        case 9: arank = "Manager";
        case 10: arank = "Owner";
        default: arank = "Unknown";
    }
    format(statsstring, sizeof(statsstring), "* Admin: [%i - %s]\n* Warning: [%i/%i] | Score: [%i] | Money: [$%i] | Kills: [%d] | Deaths: [%d]", admin, arank, warn, MAX_WARNINGS, score, money, kill, death);
    format(coordsstring, sizeof(coordsstring), "\n* SaveSkin: [%i] | Ratio: [%0.2f] | Location: [%s] | Hours: [%i] | Minutes: [%i] | Seconds: [%i]", skin, (kill / death), MAX_WARNINGS, /*Location*/, h, m, s);
    strcat(statsstring, coordsstring);
    ShowPlayerDialog(playerid, 5234, DIALOG_STYLE_MSGBOX, "Your stats:", statsstring, "Ok", "");
    return 1;
}
You were just formatting things that weren't even there. Like you had 'AdminRank, admin, Admin2' when there was only 2 specifiers. %i and %s.

Also, you are missing a 'location' parameter in this string:
pawn Code:
\n* SaveSkin: [%i] | Ratio: [%0.2f] | Location: [%s] Hours: [%i] | Minutes: [%i] | Seconds: [%i]
There is nothing giving a value to 'Location: %s'.
Reply


Messages In This Thread
Stats in dialog help - by mickos - 21.11.2014, 23:53
Re: Stats in dialog help - by Threshold - 22.11.2014, 00:31

Forum Jump:


Users browsing this thread: 1 Guest(s)