CLEO Help Samp detect new message in chat?

CLEO related
Status
Not open for further replies.

Mennims

Active member
Joined
Mar 18, 2014
Messages
41
Reaction score
0
I want a script segment to only run when a new message is added to chat, anyone got ideas? I have tried using samp.getchatstring to get two instances of the chat. So one would get chat id 99 then the other id 98 and test until they match, meaning the chat wouldve moved up. But it crashes. Why the fuck, I don't know? Sigh.
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
hi, you could do it like this

Code:
{$CLEO .cs}
{$INCLUDE SF}
0000:
repeat
wait 0
until 0AFA:  is_samp_available


0BE3: raknet setup_incoming_rpc_hook @on_new_chatline

:First
wait 0  

if
31@ == 1
then
31@ = 0
//action
end
jump @First

:on_new_chatline
0BE5: raknet 29@ = get_hook_param PARAM_PACKETID
if 29@ == RPC_ScrClientMessage
then
31@ = 1
end
0BE0: raknet hook_ret true
 
Status
Not open for further replies.
Top