CLEO Help search str1 in str2

CLEO related
Status
Not open for further replies.

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
example:

str1: [TAG]
str2: [TAG]NAME

i wanna see if str1 is in str2 and remove str1 from str2. 0c29 doesn't work
 

Ravenous

Active member
Joined
Jan 21, 2016
Messages
61
Reaction score
4
incearca asta:
Code:
{$CLEO}
{$INCLUDE SF}

0000:
repeat
wait 0
until samp.Available()
chatmsg "TagRemover by gumball3000" -1
0B34: samp register_client_command "removetag" to_label @gumball_123

while true
wait 0
end

:gumball_123
alloc 0@ 256
alloc 1@ 256

format 0@ "gumball3000[TAG]"
format 1@ "[TAG]"
0AB1: @removeTag 2 0@ 1@ 2@
chatmsg "%s" -1 2@
 
0C11: memset destination 0@ value 0 size 256
format 0@ "[TAG]gumball3000"
0AB1: @removeTag 2 0@ 1@ 2@
chatmsg "%s" -1 2@
free 0@
free 1@
samp.CmdRet()

:removeTag
{0@ - name
1@ - tag}
alloc 2@ 256
0C17: 3@ = strlen 0@
0C10: memcpy destination 2@ source 0@ size 3@
    if
    0C18: $NOT_STRING = strstr string1 2@ string2 1@
    then
    2@++
    0C17: 4@ = strlen 1@
        if
        0C18: $NOT_STRING = strstr string1 2@ string2 1@
        then
        0062: 3@ -= 4@
        0C0D: struct 0@ offset 3@ size 1 = 0
        else
        005A: 0@ += 4@
        end
    end
free 2@   
0AB2: 1 0@
 
Status
Not open for further replies.
Top