Dialog help, It's showing only 1 song. - 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: Dialog help, It's showing only 1 song. (
/showthread.php?tid=520204)
Dialog help, It's showing only 1 song. -
jueix - 17.06.2014
Ok so my dialog Is only showing one song but I want it so show all of them not only the first one. Here's the command.
pawn Код:
COMMAND:music(playerid, params[])
{
if(MusicInfo[0][Song] == 0) return SendClientMessage(playerid,COLOR_LIGHTRED,"Error: Server can't find any music.");
{
for(new i = 0; i < MAX_SERVERMUSIC;i++)
{
new string[128];
format(string, sizeof(string), "%i) %s\n", i+1,MusicInfo[i][SongName]);
ShowPlayerDialog(playerid, 7, DIALOG_STYLE_LIST, "Music Player", string, "Play", "Cancel");
return 1;
}
}
return 1;
}
At the moment the dialog is showing this.
Код:
1) Machine Gun Kelly - Swing life away.
So that show's if a player has only 1 song but if a player add's an other song it will show them both like this.
Код:
1) Machine Gun Kelly - Swing life away.
2) Linkin Park - Wastelands
any help?
Re: Dialog help, It's showing only 1 song. -
Konstantinos - 17.06.2014
You show the dialog in the loop so it will only show the first song and then you return a value which stops the loop.
pawn Код:
new string[150];
for (new i; i != sizeof (MusicInfo); ++i) format(string, sizeof (string), "%s%i) %s\n", string, i + 1, MusicInfo[i][SongName]);
ShowPlayerDialog(playerid, 7, DIALOG_STYLE_LIST, "Music Player", string, "Play", "Cancel");
Re: Dialog help, It's showing only 1 song. -
jueix - 17.06.2014
Quote:
Originally Posted by Konstantinos
You show the dialog in the loop so it will only show the first song and then you return a value which stops the loop.
pawn Код:
new string[150]; for (new i; i != sizeof (MusicInfo); ++i) format(string, sizeof (string), "%s%i) %s\n", string, i + 1, MusicInfo[i][SongName]); ShowPlayerDialog(playerid, 7, DIALOG_STYLE_LIST, "Music Player", string, "Play", "Cancel");
|
Thanks man will test it now, It works man but how can I make it stop at like 15 then say next dialog? with number 16?
Re: Dialog help, It's showing only 1 song. -
Threshold - 18.06.2014
pawn Код:
for(new i = 0; i < 16; i++)
pawn Код:
if(i == 15) strins(string, "Next Page");
Next page (OnDialogResponse):
pawn Код:
for(new i = 16; i < 32; i++)
Just examples.