CLEO Help Weird String Error

CLEO related
Status
Not open for further replies.

IbraJ

Member
Joined
May 14, 2020
Messages
13
Reaction score
1
Location
None
Code:
:test
wait 0
if
  8B4C: -1
jf @test
alloc 9@ 260          
SAMP.GetChatString(99, 9@, 10@, 11@, 12@)
if
  0AD4: $USELESS = scan_string 9@ format "* %s %s has frisked %s %s." 13@v 14@v 15@v 16@v //IF and SET
jf @test
printf "%s %s" 3000 15@v 16@v
jump @test

Instead of printing correct full name of the frisked person, it is giving it in a very odd sequence:
 

Attachments

  • 22.PNG
    22.PNG
    70.9 KB · Views: 21

IbraJ

Member
Joined
May 14, 2020
Messages
13
Reaction score
1
Location
None
@Parazitas Okay, I need to resume this thread again, sorry for that.

I've tried to put underscore between first name and surname but it doesn't work for me (sorry, code got removed). Would you help me, man?

Code:
{$CLEO .cs}

0000: NOP

REPEAT
Wait 0
Until 0AFA:


While True
Wait 0

If
0B61: samp is_local_player_spawned
Then
    0AC8: 0@ = allocate_memory_size 1024
    0AC8: 1@ = allocate_memory_size 1024
    for 31@ = 97 to 99
        0B75: samp get_chat_string 31@ text_to 0@ prefix_to 1@ color_to 2@ prefix_color_to 3@
        0AC8: 4@ = allocate_memory_size 260
        0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 123 SecondCharacter 125  memory_to_store_characters_as_text 4@
        if
        0C29: 5@ = stristr string1 4@ string2 "has frisked"
        then
            5@ += 11
            0C17: 6@ = strlen 5@
            6@ -= 1
            0C24: strncpy destination 5@ source 5@ size 6@
            chatmsg "%s" -1 5@
        end
    end
end

end  

:DeleteColorCodeFromText
{
    0AB1: @DeleteColorCodeFromText 4 text 0@ FirstCharacter 91 SecondCharacter 93  memory_to_store_characters_as_text 1@
    In: 0@ = text , FirstCharacter , SecondCharacter
    Out: 1@ = pointer to memory where characters will be stored as text
}
5@ = FALSE // inbracket
0C17: 31@ = strlen 0@
    for 30@ = 0 to 31@
        0085: 29@ = 0@ // copy pointer
        005A: 29@ += 30@  // add offset make loop
        0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
        if
        003B:   28@ == 1@  // (int)
        then
            5@ = TRUE // inbracket
        end

        if
        5@ == FALSE // inbracket
        THEN
            0A8C: write_memory 3@ size 1 value 28@ virtual_protect 1
            3@ += 1 // move to next address
        END

        if
        003B:   28@ == 2@  // (int)
        then
            5@ = FALSE // inbracket
        end
    end
0A8C: write_memory 3@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0

After getting the text, I want to put underscore between first name and surname.
 
Status
Not open for further replies.
Top