SA-MP Forums Archive
Not showing whole dialog - 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: Not showing whole dialog (/showthread.php?tid=549392)



Not showing whole dialog - FunnyBear - 06.12.2014

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


Re: Not showing whole dialog - HY - 06.12.2014

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



Re: Not showing whole dialog - FunnyBear - 06.12.2014

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.


Re: Not showing whole dialog - HY - 06.12.2014

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


Re: Not showing whole dialog - FunnyBear - 06.12.2014

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?


Re: Not showing whole dialog - Raweresh - 06.12.2014

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



Re: Not showing whole dialog - FunnyBear - 06.12.2014

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