CLEO Help Dialog Box parsing [CLEO]

CLEO related
Status
Not open for further replies.

JaggerJam

Active member
Joined
Sep 14, 2017
Messages
98
Solutions
1
Reaction score
21
Hey there!! I need some help, because I'm stuck a little bit. The thing I need is to highlight/delete the selected "item" from dialog, I have ideas.. but it doesn't properly work...

Here I'm formating the string for a dialog_list_item:

Code:
:dialog_create
alloc 31@ 128
SAMP.GetChatString(99,31@,0,29@,0)
if and
29@ == -256
0C18: $NOT_USED = strstr string1 31@ string2 "text"
then
    alloc 30@ 128
    format 30@ "%s %c" 31@ 0xA
    0C15: strcat destination 0@ source 30@
    free 30@    
end
free 31@
ret 1 0@
Then I get the dialog itself:


Highlighted selected "item" from the list:
*This dialogs was made manually
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
937
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

PHP:
0B49: samp set_current_dialog_list_item 1 /// 1,2,3,4.....
 
Last edited:

JaggerJam

Active member
Joined
Sep 14, 2017
Messages
98
Solutions
1
Reaction score
21
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

PHP:
0B49: samp set_current_dialog_list_item 1 /// 1,2,3,4.....
Ohh and here I'll put the 0c18: opcode, then I'll use strcat. Okay, thx!
 
Last edited:
Status
Not open for further replies.
Top