CLEO Help i wanna build a chat cleo

CLEO related
Status
Not open for further replies.

001

Active member
Joined
Jun 28, 2017
Messages
25
Reaction score
0
I wanna build a cleo that reads: ----------- [Hello] -----------
And replies: Whats up dude? on chat.
 

001

Active member
Joined
Jun 28, 2017
Messages
25
Reaction score
0
thats the code:
Code:
{$CLEO .cs}

0000: NOP

WAIT 1000

:HELLOCHAT
wait 0
0AC8: 3@ = allocate_memory_size 260
0AB1: call @GETCHATTEXT 1 id 99 to 3@
if
0AD4: 4@ = scan_string 3@ format "----------- [Hello] -----------"                                                                       
then
0AF9: "Whats up dude?"
end
jump @HELLOCHAT
 

Edvincik

Well-known member
Joined
Mar 15, 2016
Messages
399
Reaction score
27
001 said:
thats the code:
Code:
{$CLEO .cs}

0000: NOP

WAIT 1000

:HELLOCHAT
wait 0
0AC8: 3@ = allocate_memory_size 260
0AB1: call @GETCHATTEXT 1 id 99 to 3@
if
0AD4: 4@ = scan_string 3@ format "----------- [Hello] -----------"                                                                       
then
0AF9: "Whats up dude?"
end
jump @HELLOCHAT

Does it work for you?
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
@001
check this out man,

Code:
{$CLEO}
{$INCLUDE SF}
0000:
repeat
wait 50
until 0AFA:  is_samp_available
0B34: samp register_client_command "activate" to_label @activate
0BE3: raknet setup_incoming_rpc_hook @on_new_chatline

0AC8: 31@ = allocate_memory_size 260 //chatline
0AC8: 30@ = allocate_memory_size 260 
 
27@ = 1 // makes the mod activated after launching the game
 
while true
wait 0

    /*
    if key_down 48
    then
    24@ = 1
    end
    */
    
    if and
    27@ == 1
    24@ == 1
    then
    24@ = 0 
    samp.GetChatString(99, 31@, 0, 0, 0)     
    //chatmsg "String detected: %s" -1 31@  
        if
        //0AD4: 0@ = 31@ scan_string "hello %d" 29@  // the chatlog shows "<Michal_Monday> hello 15" but for some reason the "GetChatString" ignores the name (it doesn't happen when some other)         
        0C14: strcmp string1 31@ string2 "----------- [Hello] -----------"
        then
        //0AD3: 30@ = format "Command ready to be entered: /pm %d hello my friend" 29@
        //chatmsg 30@ -1  // replace it with "say 30@"  
        say "Whats up dude?" 
        end
    end
end


:activate
0B12: 27@ = 27@ XOR 1
if 27@ == 1
then
0AD1: show_formatted_text_highpriority "activated" time 700 
else
0AD1: show_formatted_text_highpriority "deactivated" time 700
end
samp.CmdRet

:on_new_chatline
0BE5: raknet 23@ = get_hook_param PARAM_PACKETID
if 23@ == RPC_ScrClientMessage
then
24@ = 1
end
0BE0: raknet hook_ret true

tested with cleo 4.1, samp 0.3.7 and sampfuncs 5.3.1
 

001

Active member
Joined
Jun 28, 2017
Messages
25
Reaction score
0
Malchik said:
001 said:
thats the code:
Code:
{$CLEO .cs}

0000: NOP

WAIT 1000

:HELLOCHAT
wait 0
0AC8: 3@ = allocate_memory_size 260
0AB1: call @GETCHATTEXT 1 id 99 to 3@
if
0AD4: 4@ = scan_string 3@ format "----------- [Hello] -----------"                                                                       
then
0AF9: "Whats up dude?"
end
jump @HELLOCHAT

Does it work for you?

monday said:
@001
check this out man,

Code:
{$CLEO}
{$INCLUDE SF}
0000:
repeat
wait 50
until 0AFA:  is_samp_available
0B34: samp register_client_command "activate" to_label @activate
0BE3: raknet setup_incoming_rpc_hook @on_new_chatline

0AC8: 31@ = allocate_memory_size 260 //chatline
0AC8: 30@ = allocate_memory_size 260 
 
27@ = 1 // makes the mod activated after launching the game
 
while true
wait 0

    /*
    if key_down 48
    then
    24@ = 1
    end
    */
    
    if and
    27@ == 1
    24@ == 1
    then
    24@ = 0 
    samp.GetChatString(99, 31@, 0, 0, 0)     
    //chatmsg "String detected: %s" -1 31@  
        if
        //0AD4: 0@ = 31@ scan_string "hello %d" 29@  // the chatlog shows "<Michal_Monday> hello 15" but for some reason the "GetChatString" ignores the name (it doesn't happen when some other)         
        0C14: strcmp string1 31@ string2 "----------- [Hello] -----------"
        then
        //0AD3: 30@ = format "Command ready to be entered: /pm %d hello my friend" 29@
        //chatmsg 30@ -1  // replace it with "say 30@"  
        say "Whats up dude?" 
        end
    end
end


:activate
0B12: 27@ = 27@ XOR 1
if 27@ == 1
then
0AD1: show_formatted_text_highpriority "activated" time 700 
else
0AD1: show_formatted_text_highpriority "deactivated" time 700
end
samp.CmdRet

:on_new_chatline
0BE5: raknet 23@ = get_hook_param PARAM_PACKETID
if 23@ == RPC_ScrClientMessage
then
24@ = 1
end
0BE0: raknet hook_ret true

tested with cleo 4.1, samp 0.3.7 and sampfuncs 5.3.1

its not working
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
it reacts only if the server sends that message, not if it's generated by the user, to check whether that's the issue you could uncomments these lines:

/*
if key_down 48
then
24@ = 1
end
*/


and press "0" when the last message is: "----------- [Hello] -----------", I tested it and it worked... Btw what server is it on? I'd check it
 

001

Active member
Joined
Jun 28, 2017
Messages
25
Reaction score
0
Can you compile it for me? i think my Sanny Bulider is broken, but instead of ----------- [Hello] ----------- Use ----------- [בדיקת עירנות] -----------
 
Status
Not open for further replies.
Top