[QUESTION]Dialog listitem show/hide ?
#1

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!
Reply
#2

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

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.
}
Reply
#4

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?
Reply
#5

Just delete the specific list item from numberOfRecords and recordStringHere.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)