PDA

View Full Version : Dialog


Ugaustin
03/08/2015, 12:12 AM
it appears only One name!!!dosent appear all names only one row!one name!!


if (listitem == 0)
{
new count = 0;
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pLeader] == 1)
{
new dia[1000];
GetPlayerName(i, giveplayer, sizeof(giveplayer));
format(dia, sizeof(dia), " Name: %s | Rank %d | Ph: %d\n", giveplayer,PlayerInfo[i][pRank],PlayerInfo[i][pPtel]);
//SendClientMessage(playerid,COLOR_ORANGE,dia);
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"San Andreas Police Department",dia,"Close","");
count++;
}
}
}
if(count == 0)
{
new ria[24];
strcat(ria," No Members Online!");
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"San Andreas Police Department",ria,"Close","");
}
}

Ugaustin
03/08/2015, 12:54 AM
anyone please??

RowdyrideR
03/08/2015, 01:18 AM
Can you tell me what you exactly want to do?

Variable™
03/08/2015, 01:26 AM
Removed.

Nero_3D
03/08/2015, 01:39 AM
If you show the dialog inside the loop your result will be unavoidable
Simply replacing SendClientMessage with ShowPlayerDialog wont work...


if(listitem == 0) {
new
dia[1024]
;
for(new i = GetPlayerPoolSize(); i >= 0; --i) {
if(GetPlayerName(i, giveplayer, sizeof giveplayer) && (PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pLeader] == 1)) {
format(dia, sizeof dia, "%s\n Name: %s | Rank %d | Ph: %d", dia, giveplayer, PlayerInfo[i][pRank], PlayerInfo[i][pPtel]);
}
}
if(dia[0] == EOS) {
dia = "\n No Members Online!";
}
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "San Andreas Police Department", dia[1], "Close", "");
}