[Question] Dialogue Boxes - 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: [Question] Dialogue Boxes (
/showthread.php?tid=331299)
[Question] Dialogue Boxes -
Skribblez - 04.04.2012
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.
Re: [Question] Dialogue Boxes -
SpiritEvil - 04.04.2012
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", "");
Re: [Question] Dialogue Boxes -
Skribblez - 04.04.2012
That's what I'm currently using and it's not working.
Re: [Question] Dialogue Boxes -
SpiritEvil - 04.04.2012
Any screenshots of what does it show? I'm pretty sure it should work...
Re: [Question] Dialogue Boxes -
Skribblez - 04.04.2012
Just shows one player.
Re: [Question] Dialogue Boxes -
SpiritEvil - 04.04.2012
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.
Re: [Question] Dialogue Boxes -
Skribblez - 04.04.2012
On second thought, the code I had was different. It's working now, thank you!
Re: [Question] Dialogue Boxes -
SpiritEvil - 04.04.2012
No problem, I'm glad I could help!