CLEO Help cleo

CLEO related
Status
Not open for further replies.

Browning

Member
Joined
Apr 3, 2020
Messages
7
Reaction score
0
Location
france
So i tried to make this type of code for my friends but i wont seem to work

:NONAME_105
SAMP.GetChatString(1@, 2@, 3@, 4@, 5@)
if
0@ == 1
jf @NONAME_252
if
0C29: $NOT_USED = stristr string1 2@ string2 "DO /REDEEMCREDS"
jf @NONAME_252
0AD4: $FUCK = scan_string 2@ format "/redeemcreds %s to redeem" 1@
say "/redeemcreds %s" 1@
//say 1@
 
Last edited:

Browning

Member
Joined
Apr 3, 2020
Messages
7
Reaction score
0
Location
france
I'm not sure what does it do because i'm still a newbie and i'm experimenting with things still but if you could provide a solution that'd be appreciated^^
 

Browning

Member
Joined
Apr 3, 2020
Messages
7
Reaction score
0
Location
france
dammit it wont work , is it because i have sampfuncs 5.2.2 client installed on my samp?
anyways i really appreciate the help man thanks
 

Browning

Member
Joined
Apr 3, 2020
Messages
7
Reaction score
0
Location
france
UPDATE:
so apparently the scan_string won't copy strings but it will copy integers


//when using a string
Code:
 0AD4: 28@ = scan_string 2@ format "tester %s to test" 6@
say "tested %s" 6@

//when using an integer
Code:
0AD4: 28@ = scan_string 2@ format "tester %d totest" 6@
say "tested %d" 6@


i still can't get it to copy a string
 
Last edited:

Browning

Member
Joined
Apr 3, 2020
Messages
7
Reaction score
0
Location
france
Yep won't work like this :
Code:
 0AD4: 28@ = scan_string 2@ format "tester %s to test" 6@
say "tested %s" 6@

@
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Yep won't work like this :
Code:
0AD4: 28@ = scan_string 2@ format "You have earned 10 credits! do /redeemcreds %s to redeem these credits" 6@
say "REDEEM %s" 6@
Its complicated because theres numbers and letters.. i personally dont know how to deal with this..
Both.., just wait little...
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
So.. , i tried my best explanation skills xD
Hope you guys everything clearly understand

PHP:
{$CLEO .cs}

0000:

REPEAT
   WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

WHILE TRUE
   WAIT 0

IF
0B61:  samp is_local_player_spawned
THEN
    FOR 0@ = 98 TO 99 // GET TWO LAST LINES
        0AC8: 1@ = allocate_memory_size 260 // ALLOC TO GET TEXT
        0AC8: 2@ = allocate_memory_size 260 // ALLOC TO GET PREFIX - NOT USING , BUT IS IMPORTANT TO ALLOCATE
        0B75: samp get_chat_string 0@ text_to 1@ prefix_to 2@ color_to 3@ prefix_color_to 4@ // READ CHAT TEXT , ETC..
        IF
        0C29: 5@ = stristr string1 1@ string2 "/redeemcreds" // READ 1@ AND FIND PEACE OF TEXT, 5@ = RETURN ALL TEXT FROM THAT PEACE OF TEXT TILL END
        THEN
            0C17: 6@ = strlen 5@ // GET RETURNED TEXT SIZE
            IF
            0C29: 7@ = stristr string1 5@ string2 "to redeem" // READ 5@ RETURNED TEXT AND FIND PEACE OF TEXT, 7@ = RETURN ALL TEXT FROM THAT PEACE OF TEXT TILL END
            THEN
                0C17: 8@ = strlen 7@ // GET RETURNED TEXT SIZE
                0062: 6@ -= 8@ // DELETE FROM 6@ SIZE, 8@ - RETURNED TEXT SIZE , NOW YOU KNOW THE SIZE OF TEXT WHICH YOU NEED DELETE FROM 5@ RETURNED STRING
                0C24: strncpy destination 5@ source 5@ size 6@ // COPY STRING WITH NEW SIZE OF TEXT, NOW YOU HAVE ONLY - /redeemcreds S610ppYKB5
                5@ += 13 // /redeemcreds = 12 CHARACTERS + ONE CHARACTER FOR SPACE, WHICH MEANS WE SKIP 13 CHARACTERS AND FINALLY TEXT IS - S610ppYKB5 
                CHATMSG "%s" -1 5@ // Debug / logger or whatever we calling it... xD
            END // END - 0C29: 7@ = stristr string1 5@ string2 "to redeem"
        END // END - 0C29: 5@ = stristr string1 1@ string2 "/redeemcreds"
    END // END - FOR 0@ = 98 TO 99 // GET TWO LAST LINES 
END // END - CHECK 0B61:  samp is_local_player_spawned

END // END - WHILE TRUE
 
Status
Not open for further replies.
Top