[Question] Dialogue Boxes
#1

I'm planning on creating a feature wherein players can check who are online in their family with the use of dialogue boxes. The part that I don't know is, creating the message output part.

So I've started with this:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(Player[i][Family] == Player[playerid][Family])
        {
            // What's the code here to list all the players in the same family?
        }
    }
    ShowPlayerDialog(playerid, FAMILY_DIALOGUE, DIALOG_STYLE_LIST, "Online Members", MESSAGE OUTPUT HERE, "Back", "");
As you can see, I'm not sure of what to put inside the loop to generate the text.

Reputation for anyone who could help me on this, thanks.
Reply
#2

Here you go

pawn Код:
new str[500], name[MAX_PLAYER_NAME];
for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(Player[i][Family] == Player[playerid][Family])
        {
            GetPlayerName(i, name, sizeof(name));
            format(str, sizeof(str), "%s%s\n", str, name);
        }
    }
    ShowPlayerDialog(playerid, FAMILY_DIALOGUE, DIALOG_STYLE_LIST, "Online Members", str, "Back", "");
Reply
#3

That's what I'm currently using and it's not working.
Reply
#4

Any screenshots of what does it show? I'm pretty sure it should work...
Reply
#5

Just shows one player.
Reply
#6

Check your "format" line again and make sure it's same as mine because I use the same method to detect online admins and it works perfectly fine.
Reply
#7

On second thought, the code I had was different. It's working now, thank you!
Reply
#8

No problem, I'm glad I could help!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)