SA-MP Forums Archive
[QUESTION]Dialog listitem show/hide ? - 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]Dialog listitem show/hide ? (/showthread.php?tid=374447)



[QUESTION]Dialog listitem show/hide ? - shamortiy - 02.09.2012

Hello everybody.
I have a little question - how to hide/show dialog listitem's?
Im making advanced police mdc system with dialogs, the only problem is this.Im making dialog: Add record and if u add record listitem shows up @ /mdc command, but if u delete record listitem disappears.
I really dont have idea how to do it? +rep for help.
p.s. sorry for bad english!


Re: [QUESTION]Dialog listitem show/hide ? - Roel - 02.09.2012

I'm trying to understand you, but i just don't get it...


Re: [QUESTION]Dialog listitem show/hide ? - SchurmanCQC - 02.09.2012

when making the dialog, format the string of the dialog. Every time you need a new line, make it add "\n %s"

%s = What you want to add on that line.

EDIT:

Example:

pawn Code:
new dialogString[300];//String size depends on how many records you'll usually have
format(dialogString, 300, "%s", recordStringHere);//Make sure to initialize the dialog string so there isn't an empty line at the top. (Notice how I got rid of the \n at the start.)
for(new i=1; i<numberOfRecords; i++)//Start the for. Make the for start at 1 (the second instance of recordStringHere) because 0 (the first instance of recordStringHere) is already printed at line 2.
{
    format(dialogString, "\n %s", recordStringHere);//Format the string within the for structure.
}



Re: [QUESTION]Dialog listitem show/hide ? - shamortiy - 02.09.2012

Quote:
Originally Posted by Schurman
View Post
when making the dialog, format the string of the dialog. Every time you need a new line, make it add "\n %s"

%s = What you want to add on that line.

EDIT:

Example:

pawn Code:
new dialogString[300];//String size depends on how many records you'll usually have
format(dialogString, 300, "%s", recordStringHere);//Make sure to initialize the dialog string so there isn't an empty line at the top. (Notice how I got rid of the \n at the start.)
for(new i=1; i<numberOfRecords; i++)//Start the for. Make the for start at 1 (the second instance of recordStringHere) because 0 (the first instance of recordStringHere) is already printed at line 2.
{
    format(dialogString, "\n %s", recordStringHere);//Format the string within the for structure.
}
Oh thank you very much! + rep now and can u tell me how to delete listitem?


Re: [QUESTION]Dialog listitem show/hide ? - SchurmanCQC - 02.09.2012

Just delete the specific list item from numberOfRecords and recordStringHere.