CLEO Help Quick Question

CLEO related
Status
Not open for further replies.

killme1st2

Member
Joined
May 25, 2013
Messages
15
Reaction score
0
How do I make it so my cleo mod can read a server message in the chat and then say something afterwards?
 

0B36

Expert
Joined
Jan 6, 2014
Messages
1,324
Reaction score
8
Get last chat string text, then compare the string with 0AD4 and if it returns true, take action.
 

0B36

Expert
Joined
Jan 6, 2014
Messages
1,324
Reaction score
8
[shcode=cpp]
{$CLEO}

THREAD "CHATSHIT"

REPEAT
WAIT 0
UNTIL SAMP.Available()

ALLOC 1@ = 200 // ALLOCATE MEMORY FOR THE CHAT STRING FIRST

WHILE TRUE
WAIT 0
0B75: samp get_chat_string 99 text_to 1@ prefix_to 2@ color_to 3@ prefix_color_to 4@ // CATCH THE LAST CHAT STRING AND SAVE IT FOR COMPARISON
IF
0AD4: 0@ = 1@ "killme1st2 has %s" 5@ // COMPARE THE CHAT STRING WHICH WE CAUGHT, CHANGE IN ACCORDANCE TO THE SERVER
THEN
CHATMSG "FOUND THE CHATSTRING YAY!" -1 // TAKE SOME ACTION HERE
END
END
[/shcode]

Something like that.
 

killme1st2

Member
Joined
May 25, 2013
Messages
15
Reaction score
0
0B36 said:
[shcode=cpp]
{$CLEO}

THREAD "CHATSHIT"

REPEAT
WAIT 0
UNTIL SAMP.Available()

ALLOC 1@ = 200 // ALLOCATE MEMORY FOR THE CHAT STRING FIRST

WHILE TRUE
WAIT 0
0B75: samp get_chat_string 99 text_to 1@ prefix_to 2@ color_to 3@ prefix_color_to 4@ // CATCH THE LAST CHAT STRING AND SAVE IT FOR COMPARISON
IF
0AD4: 0@ = 1@ "killme1st2 has spawned" // COMPARE THE CHAT STRING WHICH WE CAUGHT, CHANGE IN ACCORDANCE TO THE SERVER
THEN
CHATMSG "FOUND THE CHATSTRING YAY!" -1 // TAKE SOME ACTION HERE
END
END
[/shcode]

Something like that.

I used that code and it always says "FOUND THE CHAT STRING YAY!" Even if the string I am looking for isn't it.
 
Status
Not open for further replies.
Top