CLEO Help Get selected index string Dialog List

CLEO related
Status
Not open for further replies.
D

Deleted member 52446

Guest
How to get the text of selected item in a dialog list and show it in a chatmsg?
I wanna get all columns of selected Index...
Server Version : 0.3.7-R2
This code takes only the first column. =(
PHP:
{$CLEO .cs}

0000: NOP

wait 10000 // wait until samp is ready

6@ = 0
while true
wait 0
if key_down 45
then
6@ = 1
end
if 6@ == 1
then
6@ = 0
wait 1000
0B54: samp 1@ = listbox_items_count
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
end
end
 

Attachments

  • Capturar.JPG
    Capturar.JPG
    33.1 KB · Views: 48
Last edited:

Parazitas

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

Deleted member 52446

Guest
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
This code only take the First Column of listbox, I wanna take all columns, Like in the pic that I sent "Presidiário" "Tempo" "Prisão"
 
D

Deleted member 52446

Guest
You already get what you need...
And the others columns?
I wanna get all columns
This code only take the first
Using the photo sent by me as a reference
This code take only:
Henrique_17[4]
I wanna get the '01:50:45' and 'Municipal'
xD
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
And the others columns?
I wanna get all columns
This code only take the first
Using the photo sent by me as a reference
This code take only:
Henrique_17[4]
I wanna get the '01:50:45' and 'Municipal'
xD
You make you own code or use cheat engine to get pointers
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
{$CLEO .cs}

0000:

repeat
wait 0
until 0AFA:

while true
wait 0

if 0AB0: 45
then
    repeat
    wait 0
    until 8AB0: 45  // anti spam
    if
    6@ == false
    then
        6@ = 1
        0AD1: "ON" 1337
    else
        6@ = 0
        0AD1: "OFF" 1337
    end    
end

if 
6@ == 1
then
    //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
end

end
 
D

Deleted member 52446

Guest
PHP:
{$CLEO .cs}

0000:

repeat
wait 0
until 0AFA:

while true
wait 0

if 0AB0: 45
then
    repeat
    wait 0
    until 8AB0: 45  // anti spam
    if
    6@ == false
    then
        6@ = 1
        0AD1: "ON" 1337
    else
        6@ = 0
        0AD1: "OFF" 1337
    end   
end

if
6@ == 1
then
    //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
end

end
How to get the text "Hotring Racer B"?
 

Attachments

  • Capturar.jpg
    Capturar.jpg
    45.6 KB · Views: 32
Status
Not open for further replies.
Top