CLEO Help Ignore a specific message from the chat (hide it)

CLEO related
Status
Not open for further replies.

cheetahftw1

Active member
Joined
Aug 31, 2018
Messages
39
Reaction score
0
I want to make a mod that ignore only a specific message sent by the server, how I can do this? For example "You are driving your own vehicle. Use /lock or N to lock it.", i don't want to see this message. thanks.
 

HowEnCokkien

Well-known member
Joined
Jul 9, 2017
Messages
307
Reaction score
9
log outgoing rpcs, if it is sendchatmessage, filter it, if it is the specific message then nop the rpc and enable it again
 

KamikazeSripterul

Well-known member
Joined
Jun 30, 2019
Messages
353
Reaction score
23
@HowEnCokkien what do you mean by rpcs, nop etc? I'm quite sure those are keywords that beginners may not know. Would you mind explaining it? Also, he asked for deleting the message in the chat, you gave him an example of automatically replying to a certain message in the chat. I may have got something wrong, please explain in more detail. Thanks!
 

HowEnCokkien

Well-known member
Joined
Jul 9, 2017
Messages
307
Reaction score
9
not in pc, so can't check if it works, give it a try

Code:
{$CLEO .cs}
0000:

0BE3: raknet setup_incoming_rpc_hook @cm

$f = FALSE

REPEAT
 WAIT 100
UNTIL 0AFA: SAMP_IS_READY

0B34: "block" @key

WHILE TRUE
 WAIT 0
  IF
   $f == TRUE
  THEN
   alloc 260 3@
   SAMP.GetChatString(99, 3@, 0, 0, 0)
    IF
     0C14: 3@ "You are driving your own vehicle. Use /lock or N to lock it."
    THEN
      $c = TRUE
    END
  END
END

:key
IF
 $f == FALSE
THEN
 $f = TRUE
 chatmsg "On!" -1
ELSE
 $f = FALSE
 chatmsg "Off!" -1
END
cmdret

:cm
0BE5: raknet 0@ = get_hook_param 1
IF
  0@ ==  93
THEN
 IF AND
  $f == TRUE
  $c == TRUE
 THEN
  0BE0: raknet hook_ret FALSE
 ELSE
  0BE0: raknet hook_ret TRUE
 END
END
 
Status
Not open for further replies.
Top