Not showing whole dialog
#1

Hey,

I'm currently making a system where Admins can view other players stats by clicking on their name (On the TAB list). But when I click on someones name ingame it will only show the last line.

pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    if( pInfo[playerid][pAdmin] >= 1)
    {
        new
            clickedname[MAX_PLAYER_NAME];

        GetPlayerName(clickedplayerid, clickedname, sizeof(clickedname));

        new IP[16];

        GetPlayerIp(clickedplayerid, IP, sizeof(IP));

        new pDialog[1500];
        format(pDialog, sizeof(pDialog), "{FFE226}Name - {FFFFFF}%s[%d]\n\n", clickedname, clickedplayerid );
        format(pDialog, sizeof(pDialog), "{FFE226}IP - {FFFFFF}%s\n", IP);
        format(pDialog, sizeof(pDialog), "{FFE226}Score - {FFFFFF}%d\n", GetPlayerScore(clickedplayerid) );
        format(pDialog, sizeof(pDialog), "{FFE226}Money - {FFFFFF}%d\n", GetPlayerMoney(clickedplayerid) );
        format(pDialog, sizeof(pDialog), "{FFE226}Kills - {FFFFFF}%d\n", pInfo[clickedplayerid][pKills]);
        format(pDialog, sizeof(pDialog), "{FFE226}Deaths - {FFFFFF}%d\n", pInfo[clickedplayerid][pDeaths]);
        format(pDialog, sizeof(pDialog), "{FFE226}Warnings - {FFFFFF}%d\n", pInfo[clickedplayerid][pWarns]);
        format(pDialog, sizeof(pDialog), "{FFE226}Warnings - {FFFFFF}%d\n\n", pInfo[clickedplayerid][pWarns]);
        format(pDialog, sizeof(pDialog), "{FFE226}Extras:\n");
        format(pDialog, sizeof(pDialog), "{FFE226}Admin Level - {FFFFFF}%d\n", pInfo[clickedplayerid][pAdmin]);
        format(pDialog, sizeof(pDialog), "{FFE226}VIP Level - {FFFFFF}%d\n", pInfo[clickedplayerid][pVip]);
        format(pDialog, sizeof(pDialog), "{FFE226}Swat Level - {FFFFFF}%d\n", pInfo[clickedplayerid][pSwat]);
        format(pDialog, sizeof(pDialog), "{FFE226}Army Level - {FFFFFF}%d\n", pInfo[clickedplayerid][pArmy]);
        format(pDialog, sizeof(pDialog), "{FFE226}Online Time - {FFFFFF}Hours: %d | Minutes: %d | Seconds: %d \n", pInfo[clickedplayerid][pHours], pInfo[clickedplayerid][pMinutes], pInfo[clickedplayerid][pSeconds]);
        ShowPlayerDialog(playerid, 8277272, DIALOG_STYLE_MSGBOX, "{FFE226}Players Stats", pDialog, "OK", "");
    }
    return 1;
}
So, ingame it only shows the players online time. How can I fix this and show the whole dialog?

Thanks
Reply
#2

pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    if( pInfo[playerid][pAdmin] >= 1)
    {
        new
            clickedname[MAX_PLAYER_NAME];

        GetPlayerName(clickedplayerid, clickedname, sizeof(clickedname));

        new IP[16];

        GetPlayerIp(clickedplayerid, IP, sizeof(IP));

        new pDialog[1500];
        format(pDialog, sizeof(pDialog), "{FFE226}Name - {FFFFFF}%s[%d]\n\n", clickedname, clickedplayerid );
        format(pDialog, sizeof(pDialog), "{FFE226}IP - {FFFFFF}%s\n", IP);
        format(pDialog, sizeof(pDialog), "{FFE226}Score - {FFFFFF}%d\n", GetPlayerScore(clickedplayerid) );
        format(pDialog, sizeof(pDialog), "{FFE226}Money - {FFFFFF}%d\n", GetPlayerMoney(clickedplayerid) );
        format(pDialog, sizeof(pDialog), "{FFE226}Kills - {FFFFFF}%d\n", pInfo[clickedplayerid][pKills]);
        format(pDialog, sizeof(pDialog), "{FFE226}Deaths - {FFFFFF}%d\n", pInfo[clickedplayerid][pDeaths]);
        format(pDialog, sizeof(pDialog), "{FFE226}Warnings - {FFFFFF}%d\n", pInfo[clickedplayerid][pWarns]);
        format(pDialog, sizeof(pDialog), "{FFE226}Warnings - {FFFFFF}%d\n\n", pInfo[clickedplayerid][pWarns]);
        format(pDialog, sizeof(pDialog), "{FFE226}Extras:\n");
        format(pDialog, sizeof(pDialog), "{FFE226}Admin Level - {FFFFFF}%d\n", pInfo[clickedplayerid][pAdmin]);
        format(pDialog, sizeof(pDialog), "{FFE226}VIP Level - {FFFFFF}%d\n", pInfo[clickedplayerid][pVip]);
        format(pDialog, sizeof(pDialog), "{FFE226}Swat Level - {FFFFFF}%d\n", pInfo[clickedplayerid][pSwat]);
        format(pDialog, sizeof(pDialog), "{FFE226}Army Level - {FFFFFF}%d\n", pInfo[clickedplayerid][pArmy]);
        format(pDialog, sizeof(pDialog), "{FFE226}Online Time - {FFFFFF}Hours: %d | Minutes: %d | Seconds: %d \n", pInfo[clickedplayerid][pHours], pInfo[clickedplayerid][pMinutes], pInfo[clickedplayerid][pSeconds]);
        ShowPlayerDialog(playerid, 7890, DIALOG_STYLE_MSGBOX, "{FFE226}Players Stats", pDialog, "OK", "");
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by HY
Посмотреть сообщение
pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    if( pInfo[playerid][pAdmin] >= 1)
    {
        new
            clickedname[MAX_PLAYER_NAME];

        GetPlayerName(clickedplayerid, clickedname, sizeof(clickedname));

        new IP[16];

        GetPlayerIp(clickedplayerid, IP, sizeof(IP));

        new pDialog[1500];
        format(pDialog, sizeof(pDialog), "{FFE226}Name - {FFFFFF}%s[%d]\n\n", clickedname, clickedplayerid );
        format(pDialog, sizeof(pDialog), "{FFE226}IP - {FFFFFF}%s\n", IP);
        format(pDialog, sizeof(pDialog), "{FFE226}Score - {FFFFFF}%d\n", GetPlayerScore(clickedplayerid) );
        format(pDialog, sizeof(pDialog), "{FFE226}Money - {FFFFFF}%d\n", GetPlayerMoney(clickedplayerid) );
        format(pDialog, sizeof(pDialog), "{FFE226}Kills - {FFFFFF}%d\n", pInfo[clickedplayerid][pKills]);
        format(pDialog, sizeof(pDialog), "{FFE226}Deaths - {FFFFFF}%d\n", pInfo[clickedplayerid][pDeaths]);
        format(pDialog, sizeof(pDialog), "{FFE226}Warnings - {FFFFFF}%d\n", pInfo[clickedplayerid][pWarns]);
        format(pDialog, sizeof(pDialog), "{FFE226}Warnings - {FFFFFF}%d\n\n", pInfo[clickedplayerid][pWarns]);
        format(pDialog, sizeof(pDialog), "{FFE226}Extras:\n");
        format(pDialog, sizeof(pDialog), "{FFE226}Admin Level - {FFFFFF}%d\n", pInfo[clickedplayerid][pAdmin]);
        format(pDialog, sizeof(pDialog), "{FFE226}VIP Level - {FFFFFF}%d\n", pInfo[clickedplayerid][pVip]);
        format(pDialog, sizeof(pDialog), "{FFE226}Swat Level - {FFFFFF}%d\n", pInfo[clickedplayerid][pSwat]);
        format(pDialog, sizeof(pDialog), "{FFE226}Army Level - {FFFFFF}%d\n", pInfo[clickedplayerid][pArmy]);
        format(pDialog, sizeof(pDialog), "{FFE226}Online Time - {FFFFFF}Hours: %d | Minutes: %d | Seconds: %d \n", pInfo[clickedplayerid][pHours], pInfo[clickedplayerid][pMinutes], pInfo[clickedplayerid][pSeconds]);
        ShowPlayerDialog(playerid, 7890, DIALOG_STYLE_MSGBOX, "{FFE226}Players Stats", pDialog, "OK", "");
    }
    return 1;
}
Tested it, and it's still not working.
Reply
#4

Well more simple I think it's with strcat function. Also, you can look on this tutorial!
Reply
#5

Quote:
Originally Posted by HY
Посмотреть сообщение
Well more simple I think it's with strcat function. Also, you can look on this tutorial!
I've that tutorial before, but its not really much help. Any way to fix this?
Reply
#6

Just do like this and that will be work.
Код:
        format(pDialog, sizeof(pDialog), "{FFE226}Name - {FFFFFF}%s[%d]\n\n", clickedname, clickedplayerid );
        format(pDialog, sizeof(pDialog), "%s{FFE226}IP - {FFFFFF}%s\n",pDialog, IP);
        format(pDialog, sizeof(pDialog), "%s{FFE226}Score - {FFFFFF}%d\n",pDialog, GetPlayerScore(clickedplayerid) );
        format(pDialog, sizeof(pDialog), "%s{FFE226}Money - {FFFFFF}%d\n",pDialog, GetPlayerMoney(clickedplayerid) );
        format(pDialog, sizeof(pDialog), "%s{FFE226}Kills - {FFFFFF}%d\n",pDialog, pInfo[clickedplayerid][pKills]);
        format(pDialog, sizeof(pDialog), "%s{FFE226}Deaths - {FFFFFF}%d\n",pDialog, pInfo[clickedplayerid][pDeaths]);
        format(pDialog, sizeof(pDialog), "%s{FFE226}Warnings - {FFFFFF}%d\n",pDialog, pInfo[clickedplayerid][pWarns]);
        format(pDialog, sizeof(pDialog), "%s{FFE226}Warnings - {FFFFFF}%d\n\n",pDialog, pInfo[clickedplayerid][pWarns]);
        format(pDialog, sizeof(pDialog), "%s{FFE226}Extras:\n",pDialog,);
        format(pDialog, sizeof(pDialog), "%s{FFE226}Admin Level - {FFFFFF}%d\n",pDialog, pInfo[clickedplayerid][pAdmin]);
        format(pDialog, sizeof(pDialog), "%s{FFE226}VIP Level - {FFFFFF}%d\n",pDialog, pInfo[clickedplayerid][pVip]);
        format(pDialog, sizeof(pDialog), "%s{FFE226}Swat Level - {FFFFFF}%d\n",pDialog, pInfo[clickedplayerid][pSwat]);
        format(pDialog, sizeof(pDialog), "%s{FFE226}Army Level - {FFFFFF}%d\n",pDialog, pInfo[clickedplayerid][pArmy]);
        format(pDialog, sizeof(pDialog), "%s{FFE226}Online Time - {FFFFFF}Hours: %d | Minutes: %d | Seconds: %d \n",pDialog, pInfo[clickedplayerid][pHours], pInfo[clickedplayerid][pMinutes], pInfo[clickedplayerid][pSeconds]);
Reply
#7

Quote:
Originally Posted by Raweresh
Посмотреть сообщение
Just do like this and that will be work.
Код:
        format(pDialog, sizeof(pDialog), "{FFE226}Name - {FFFFFF}%s[%d]\n\n", clickedname, clickedplayerid );
        format(pDialog, sizeof(pDialog), "%s{FFE226}IP - {FFFFFF}%s\n",pDialog, IP);
        format(pDialog, sizeof(pDialog), "%s{FFE226}Score - {FFFFFF}%d\n",pDialog, GetPlayerScore(clickedplayerid) );
        format(pDialog, sizeof(pDialog), "%s{FFE226}Money - {FFFFFF}%d\n",pDialog, GetPlayerMoney(clickedplayerid) );
        format(pDialog, sizeof(pDialog), "%s{FFE226}Kills - {FFFFFF}%d\n",pDialog, pInfo[clickedplayerid][pKills]);
        format(pDialog, sizeof(pDialog), "%s{FFE226}Deaths - {FFFFFF}%d\n",pDialog, pInfo[clickedplayerid][pDeaths]);
        format(pDialog, sizeof(pDialog), "%s{FFE226}Warnings - {FFFFFF}%d\n",pDialog, pInfo[clickedplayerid][pWarns]);
        format(pDialog, sizeof(pDialog), "%s{FFE226}Warnings - {FFFFFF}%d\n\n",pDialog, pInfo[clickedplayerid][pWarns]);
        format(pDialog, sizeof(pDialog), "%s{FFE226}Extras:\n",pDialog,);
        format(pDialog, sizeof(pDialog), "%s{FFE226}Admin Level - {FFFFFF}%d\n",pDialog, pInfo[clickedplayerid][pAdmin]);
        format(pDialog, sizeof(pDialog), "%s{FFE226}VIP Level - {FFFFFF}%d\n",pDialog, pInfo[clickedplayerid][pVip]);
        format(pDialog, sizeof(pDialog), "%s{FFE226}Swat Level - {FFFFFF}%d\n",pDialog, pInfo[clickedplayerid][pSwat]);
        format(pDialog, sizeof(pDialog), "%s{FFE226}Army Level - {FFFFFF}%d\n",pDialog, pInfo[clickedplayerid][pArmy]);
        format(pDialog, sizeof(pDialog), "%s{FFE226}Online Time - {FFFFFF}Hours: %d | Minutes: %d | Seconds: %d \n",pDialog, pInfo[clickedplayerid][pHours], pInfo[clickedplayerid][pMinutes], pInfo[clickedplayerid][pSeconds]);
It works! Thanks +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)