CLEO Help One Message Send

CLEO related
Status
Not open for further replies.

alborosie

Active member
Joined
Aug 16, 2017
Messages
68
Reaction score
3
Hello everybody!
I want to make a cleo that sends one message on chat from a big list, with only one command.
Can someone explain me how to do it?
 

Safa

Well-known member
Joined
Feb 24, 2015
Messages
342
Reaction score
127
Hello everybody!
I want to make a cleo that sends one message on chat from a big list, with only one command.
Can someone explain me how to do it?
B1-g list? Not sure what you mean but I hope you know that strings have max. size / chat.
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
227
Location
( ͡° ͜ʖ ͡°)
You want something like dis:
Code:
{$CLEO .cs}
0000:


REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY
0@ = 0

WHILE TRUE
    WAIT 0
    IF
    0AB0: 88
    THEN
        REPEAT
            WAIT 0
        UNTIL 8AB0: 88
        0@++ // increase by 1;
        IF 0@ > 3 // ID 3 IS MAX
        THEN
            0@ = 0
        END
        
        
        
        0AB1: call @readStringFromList 2 list @ChatStrings string_number 0@ to 1@
        0AC8: 2@ = allocate_memory_size 260       
        0AD3: 2@ = format "%s" 1@
        0AF9: samp say_msg "ID: %d, TEXT: %s" 0@ 2@
        0AC9: free_allocated_memory 2@


        
        
        
        
    END
END



:ChatStrings
0900: "I bet your boyfriend doesnt even kiss ya" // ID 0
0900: "Hit or Miss"                              // ID 1
0900: "I guess they never miss huh"              // ID 2
0900: "He gonn find another girl and he wont miss ya" // ID 3
0000:



:readStringFromList
var
1@ : int
2@ : int
end
0AC6: 0@ = label 0@ offset
0@ += 4
2@ = 0
while 2@ < 1@
    3@ = 1
    while 3@ <> 0
        0A8D: 3@ = read_memory 0@ size 1 virtual_protect 0
        inc(0@)
    end
    0@ += 3
    inc(2@)
end
ret 1 0@
 

alborosie

Active member
Joined
Aug 16, 2017
Messages
68
Reaction score
3
You want something like dis:
Code:
{$CLEO .cs}
0000:


REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY
0@ = 0

WHILE TRUE
    WAIT 0
    IF
    0AB0: 88
    THEN
        REPEAT
            WAIT 0
        UNTIL 8AB0: 88
        0@++ // increase by 1;
        IF 0@ > 3 // ID 3 IS MAX
        THEN
            0@ = 0
        END
       
       
       
        0AB1: call @readStringFromList 2 list @ChatStrings string_number 0@ to 1@
        0AC8: 2@ = allocate_memory_size 260      
        0AD3: 2@ = format "%s" 1@
        0AF9: samp say_msg "ID: %d, TEXT: %s" 0@ 2@
        0AC9: free_allocated_memory 2@


       
       
       
       
    END
END



:ChatStrings
0900: "I bet your boyfriend doesnt even kiss ya" // ID 0
0900: "Hit or Miss"                              // ID 1
0900: "I guess they never miss huh"              // ID 2
0900: "He gonn find another girl and he wont miss ya" // ID 3
0000:



:readStringFromList
var
1@ : int
2@ : int
end
0AC6: 0@ = label 0@ offset
0@ += 4
2@ = 0
while 2@ < 1@
    3@ = 1
    while 3@ <> 0
        0A8D: 3@ = read_memory 0@ size 1 virtual_protect 0
        inc(0@)
    end
    0@ += 3
    inc(2@)
end
ret 1 0@
and how i should activate it?
 

alborosie

Active member
Joined
Aug 16, 2017
Messages
68
Reaction score
3
You want something like dis:
Code:
{$CLEO .cs}
0000:


REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY
0@ = 0

WHILE TRUE
    WAIT 0
    IF
    0AB0: 88
    THEN
        REPEAT
            WAIT 0
        UNTIL 8AB0: 88
        0@++ // increase by 1;
        IF 0@ > 3 // ID 3 IS MAX
        THEN
            0@ = 0
        END
       
       
       
        0AB1: call @readStringFromList 2 list @ChatStrings string_number 0@ to 1@
        0AC8: 2@ = allocate_memory_size 260      
        0AD3: 2@ = format "%s" 1@
        0AF9: samp say_msg "ID: %d, TEXT: %s" 0@ 2@
        0AC9: free_allocated_memory 2@


       
       
       
       
    END
END



:ChatStrings
0900: "I bet your boyfriend doesnt even kiss ya" // ID 0
0900: "Hit or Miss"                              // ID 1
0900: "I guess they never miss huh"              // ID 2
0900: "He gonn find another girl and he wont miss ya" // ID 3
0000:



:readStringFromList
var
1@ : int
2@ : int
end
0AC6: 0@ = label 0@ offset
0@ += 4
2@ = 0
while 2@ < 1@
    3@ = 1
    while 3@ <> 0
        0A8D: 3@ = read_memory 0@ size 1 virtual_protect 0
        inc(0@)
    end
    0@ += 3
    inc(2@)
end
ret 1 0@
In the chat, it says: "ID: D, TEXT: S".
 
Status
Not open for further replies.
Top