CLEO Help scan string issue

CLEO related
Status
Not open for further replies.

habbike05

Member
Joined
Sep 15, 2014
Messages
6
Reaction score
0
Hello everybody. i'm having a issue on my code, the problem is the scan_string is never true and idk what i'm doing wrong, i've already read many threads and i can't fix it, pls help.


Code:
while true
    wait 50
    0AC9: free_allocated_memory 15@
    alloc 15@ = 260
    SAMP.GetChatString( 99, 15@, 16@, 17@, 18@)

        if or
        0AD4: $NOT_USED = scan_string 15@ format "* %s pescou um peixe com %d kilos." $NOT_USED $NOT_USED
        0C14: strcmp string1 15@ string2 "Você não conseguiu pescar nada."
        then
        wait 100                                                       
        0AF9: "/pescar"
        0AC9: free_allocated_memory 15@
        wait 100
        break
        end
    0AC9: free_allocated_memory 15@
    
end //Fim do while

Ingame lines
 

Attachments

  • Screenshot_2.png
    Screenshot_2.png
    2 KB · Views: 27
  • Screenshot_3.png
    Screenshot_3.png
    2.3 KB · Views: 27

Zin

Expert
Joined
Aug 1, 2013
Messages
1,716
Solutions
1
Reaction score
111
Use "LOG" to send the chat strings to your sampfuncs console and compare the strings yourself as 0AD4 needs to be exact, still unsure whether {FFFFFF} sort of thing matters (probably doesn't matter if it's in the "prefix" of the message but sometimes they aren't), if not you can just use opcode 0C21 instead of 0C14 which basically only looks for a string you specify within a string.
 

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
0B61:  samp is_local_player_spawned
then
    for 0@ = 98 to 99 // last two lines
        0AC8: 1@ = allocate_memory_size 260 // allocate to get text
        0AC8: 2@ = allocate_memory_size 260 // allocate prext , not used , but is important to allocate
        0B75: samp get_chat_string 0@ text_to 1@ prefix_to 2@ color_to 3@ prefix_color_to 4@
        if or
        0C29: $NOT_USED = stristr string1 1@ string2 "Você não conseguiu pescar nada."
        0C29: $NOT_USED = stristr string1 1@ string2 "pescou um peixe com"
        then
            0AF8: samp add_message_to_chat " " color -1 // add emty chatmsg
            0AF8: samp add_message_to_chat " " color -1 // add emty chatmsg                                                    
            0AF9: "/pescar"
        end  
    end
end

end
 
Last edited:

habbike05

Member
Joined
Sep 15, 2014
Messages
6
Reaction score
0
@habbike05 i told u, u dont need break.. i am quite experienced and i never met break command in cleo..
Nice men, tks for your help.


PHP:
{$CLEO}

0000:

wait 8500

while true
wait 50

if
0B61:  samp is_local_player_spawned
then
    for 0@ = 98 to 99 // last two lines
        0AC8: 1@ = allocate_memory_size 260 // allocate to get text
        0AC8: 2@ = allocate_memory_size 260 // allocate prext , not used , but is important to allocate
        0B75: samp get_chat_string 0@ text_to 1@ prefix_to 2@ color_to 3@ prefix_color_to 4@
        if or
        0C29: $NOT_USED = stristr string1 1@ string2 "Você não conseguiu pescar nada."
        0C29: $NOT_USED = stristr string1 1@ string2 "pescou um peixe com"
        then
            0AF8: samp add_message_to_chat " " color -1 // add emty chatmsg
            0AF8: samp add_message_to_chat " " color -1 // add emty chatmsg                                                    
            0AF9: "/pescar"
        end  
    end
end

end
I think its working now because im receiving this error but i think the problem now is my gta.
 

Attachments

  • Screenshot_2.png
    Screenshot_2.png
    276.9 KB · Views: 21
Status
Not open for further replies.
Top