SA-MP Forums Archive
Dialog lists.. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dialog lists.. (/showthread.php?tid=109954)



Dialog lists.. - Mikep. - 23.11.2009

How the hell do I make a dialog list with 110 items?

If I do it on one line, it wont fit, so i tried the

blabla\n\
blablabla\n\
etc.

thing, and it gave an error: input line too long (after substitutions).

Without formatting a string, how can I do it..?


Re: Dialog lists.. - Daren_Jacobson - 23.11.2009

da format.

pawn Код:
new reallylongstring[1500];
format(reallylongstring, sizeof(reallylongstring), "item1\nitem2\ni3\ni4");
format(reallylongstring, sizeof(reallylongstring), "%sitem5\nitem6\ni7\ni8", reallylongstring);
format(reallylongstring, sizeof(reallylongstring), "%sitem9\nitem10\ni11\ni12", reallylongstring);



Re: Dialog lists.. - Mikep. - 23.11.2009

I don't want to do it like that. There must be another way.


Re: Dialog lists.. - Correlli - 23.11.2009

Do as Daren_Jacobson told you or just do it like this:

pawn Код:
format(reallylongstring, sizeof(reallylongstring), "item_1\nitem_2\nitem_3\nitem_4\nitem_5\
\nitem_6\nitem_7\nitem_8\nitem_9\nitem_10\
\nitem_11\nitem_12\nitem_13\nitem_14\nitem_15\
\nitem_16\nitem_17\nitem_18\nitem_19\nitem_20\
\nitem_and_so_on.."
);



Re: Dialog lists.. - Donny_k - 23.11.2009

You don't have to use 'format()' to produce the 'substitutions' error, it's the string limitation (507 IIRC).

Also what's wrong with formatting the string ?

You could use strins or strmid I suppose but I don't understand why you don't want to use the functions provided for doing this, that's the whole reason we have those functions.

What are you putting in the string, is it raw (you're typing it) or is it from an array or another source ?


Re: Dialog lists.. - Mikep. - 23.11.2009

Quote:
Originally Posted by Donny
You don't have to use 'format()' to produce the 'substitutions' error, it's the string limitation (507 IIRC).

Also what's wrong with formatting the string ?

You could use strins or strmid I suppose but I don't understand why you don't want to use the functions provided for doing this, that's the whole reason we have those functions.

What are you putting in the string, is it raw (you're typing it) or is it from an array or another source ?
It's raw, not using any unneccecary memory, but i'll have to format() I guess.


Re: Dialog lists.. - Donny_k - 23.11.2009

You could always split the dialog up and have a "more" or "next" option in the list or use the 'button' params to do it, if the response is true then goto the next one and so on.


Re: Dialog lists.. - Mikep. - 23.11.2009

The reason for me using a dialog instead of GTA menus is because I didn't want that.

It works fine now.



Re: Dialog lists.. - Donny_k - 23.11.2009

Panels are ugly anyway I prefer dialogs, good to know it's sorted.