CLEO Help [SA:MP] Another dialog question

CLEO related
Status
Not open for further replies.

RewardK

Member
Joined
Jun 2, 2018
Messages
13
Reaction score
0
Hello again, UG-Base.

I have one more question, how can I get the listitem from a dialog by line name.
For example, if I have a dialog with next rows: "Dog, Cat, Cow, Wolf", but this rows are mixed, it is not always in this order. It can be: "Cat, Wolf, Cow, Dog" or another way.
Can I get the listitem of line Wolf, regardless of whether the item is? Whether it is the first or last, or the third, and so on.

For example: I want to search in this dialog content for 'MEDICAL KIT', but this option does not always have listitem 2.
It can have listitem 0, or 3, or whatever.

Can I get the listitem from "Medical Kit" whether is he pointed?


Sorry for my bad english.
Thanks for spending time with me.

I want only the code with can I get the listitem of "Medical Kit"
 

Attachments

  • 1561044353162.png
    1561044353162.png
    80.9 KB · Views: 20

Parazitas

God
Joined
Jan 2, 2017
Messages
3,112
Solutions
5
Reaction score
878
Location
Lithuania
PHP:
//get number of dialog elements
0B54: samp 1@ = listbox_items_count

//substract one from total cout
1@ -= 1 //last item is actually the null terminator

chatmsg "num of elements %d" -1 1@

for 0@ = 0 to 1@
alloc 2@ = 256
0B5B: samp get_listbox_item 0@ text_to 2@      
chatmsg "element %d - text: %s" -1 0@ 2@
free 2@
end
 

RewardK

Member
Joined
Jun 2, 2018
Messages
13
Reaction score
0
PHP:
//get number of dialog elements
0B54: samp 1@ = listbox_items_count

//substract one from total cout
1@ -= 1 //last item is actually the null terminator

chatmsg "num of elements %d" -1 1@

for 0@ = 0 to 1@
alloc 2@ = 256
0B5B: samp get_listbox_item 0@ text_to 2@     
chatmsg "element %d - text: %s" -1 0@ 2@
free 2@
end
Thank u so much.
 
Status
Not open for further replies.
Top