Items not showing up within list...
#1

I've got the following code:

pawn Код:
// - N/A
If however I use the command /misc, the dialog appears, but the list items don't. I've been sitting on this confused
for the last two hours, seeing I've tried to re-build it over and over, but the same thing happens every time. Any ideas? Thanks for the assistance.
Reply
#2

Instead you should join them with strcat

pawn Код:
strcat(sz_text, text, sizeof(sz_text));
Instead of
pawn Код:
format(sz_text, sizeof(sz_text), "%s\n%s", sz_text, text);
Though, make sure you put \n in the first format

Though I do see what you were trying to do - might as well just use strcat
Reply
#3

Quote:
Originally Posted by [ABK]Antonio
Посмотреть сообщение
Instead you should join them with strcat

pawn Код:
strcat(sz_text, text, sizeof(sz_text));
Instead of
pawn Код:
format(sz_text, sizeof(sz_text), "%s\n%s", sz_text, text);
Though, make sure you put \n in the first format

Though I do see what you were trying to do - might as well just use strcat
Thanks for pointing that out, never thought of using strcat. As for the original issue, I'm come to the realization there is a looping issue. I put a print directly under.

pawn Код:
for(new m = 0; m < sizeof(AlternativeMusicInfo); m ++)
And nothing was printed into the console. Seeing this, I thought the 'sizeof(AlternativeMusicInfo);' was the problem, so I changed it to '6' and '7', yet it still had the same effect and result.
Reply
#4

pawn Код:
CMD:misc(playerid, params[])
{
    new sz_text[1024],a;
    for(; a < sizeof AlternativeMusicInfo; ++a)
    {
        strcat(sz_text, AlternativeMusicInfo[a][StationName]);
        strcat(sz_text,"\n");
        printf(#%s,sz_text);
    }
    ShowPlayerDialog(playerid, DIALOG_MUSICMAIN, DIALOG_STYLE_LIST, "Misc Music", sz_text, "Play", "Cancel");
    return 1;
}
Reply
#5

Thanks. The issue has been resolved.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)