CLEO Help Remove blank spaces/lines

CLEO related
Status
Not open for further replies.

JegaTurn

Active member
Joined
Nov 7, 2017
Messages
27
Reaction score
0
Hi,

On multiple servers administrators clear chat when something unusual happens, usually by writing a lot of blank spaces.
I wanted to know how I can remove these white spaces and "bypass" the ChatClear. Can anybody help me?
 

_=Gigant=_

Well-known member
Joined
Mar 21, 2017
Messages
353
Reaction score
16
JegaTurn said:
Hi,

On multiple servers administrators clear chat when something unusual happens, usually by writing a lot of blank spaces.
I wanted to know how I can remove these white spaces and "bypass" the ChatClear. Can anybody help me?

if admin  already cleared chat you cant stop that or back it up you can only clear chat by yourself if you want

type /.cc to clear chat

[attachment=5262]
 

Attachments

  • ClearChat.cs
    17.8 KB · Views: 20

ItsRobinson

Active member
Joined
Nov 16, 2017
Messages
105
Reaction score
20
All that happens when admin's clear chat is it types out many blank lines. So that you can't scroll all the way to the top.

Which means the chat is never actually gone.

If you head to your Documents > GTA San Andreas Userfiles > SAMP > chatlog.txt

You'll find all the chat before the clear in there.
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
this code was posted by noob213 in here: http://ugbase.eu/Thread-HELP-Detecting-new-chat-line
I just added the condition to get rid of the line if it's length is equal to or smaller than 1. I also added commented out debug line which you can uncomment if it won't work (in case if the server is actually sending lines full of spaces instead of 0 length messages)

[shcode=cpp]{$CLEO}
{$INCLUDE SF}
0000: NOP
while not SAMP.Available()
  wait 400
end
0BE3: raknet setup_incoming_rpc_hook @in_rpc

WHILE TRUE
WAIT 0

wait 1000
END


:in_rpc                  
0BE5: raknet 0@ = get_hook_param PARAM_PACKETID
if 0@ == RPC_SCRCLIENTMESSAGE
then
  0BE5: raknet 1@ = get_hook_param PARAM_BITSTREAM
  0BE7: raknet 2@ = bit_stream_read 1@ type BS_TYPE_INT
  0BE7: raknet 3@ = bit_stream_read 1@ type BS_TYPE_INT
 
  0AC8: 4@ = allocate_memory_size 145
  0BE8: raknet bit_stream 1@ read_array 4@ size 3@
  0C0D: struct 4@ offset 3@ size 1 = 0
 
  // uncomment the following line to see the actual length of the clearing lines (to see if they're empty "" or actually are long messages of empty spaces like "           ")
  // chatmsg "%d" -1 3@
 
  if 1 >= 3@
  then
  0AC9: free_allocated_memory 4@
  0BE0: raknet hook_ret false
  end

  0AC9: free_allocated_memory 4@
end
0BE0: raknet hook_ret true[/shcode]


btw
Code:
if 1 >= 3@
  then
  //here you could add something like:
  // print "The empty chat line was received" 1000
  0AC9: free_allocated_memory 4@
  0BE0: raknet hook_ret false
end
this way you'll know when admins wanted to clear the chat and what was there
 

JegaTurn

Active member
Joined
Nov 7, 2017
Messages
27
Reaction score
0
monday said:
this code was posted by noob213 in here: http://ugbase.eu/Thread-HELP-Detecting-new-chat-line
I just added the condition to get rid of the line if it's length is equal to or smaller than 1. I also added commented out debug line which you can uncomment if it won't work (in case if the server is actually sending lines full of spaces instead of 0 length messages)

[shcode=cpp]{$CLEO}
{$INCLUDE SF}
0000: NOP
while not SAMP.Available()
  wait 400
end
0BE3: raknet setup_incoming_rpc_hook @in_rpc

WHILE TRUE
WAIT 0

wait 1000
END


:in_rpc                  
0BE5: raknet 0@ = get_hook_param PARAM_PACKETID
if 0@ == RPC_SCRCLIENTMESSAGE
then
  0BE5: raknet 1@ = get_hook_param PARAM_BITSTREAM
  0BE7: raknet 2@ = bit_stream_read 1@ type BS_TYPE_INT
  0BE7: raknet 3@ = bit_stream_read 1@ type BS_TYPE_INT
 
  0AC8: 4@ = allocate_memory_size 145
  0BE8: raknet bit_stream 1@ read_array 4@ size 3@
  0C0D: struct 4@ offset 3@ size 1 = 0
 
  // uncomment the following line to see the actual length of the clearing lines (to see if they're empty "" or actually are long messages of empty spaces like "           ")
  // chatmsg "%d" -1 3@
 
  if 1 >= 3@
  then
  0AC9: free_allocated_memory 4@
  0BE0: raknet hook_ret false
  end

  0AC9: free_allocated_memory 4@
end
0BE0: raknet hook_ret true[/shcode]


btw
Code:
if 1 >= 3@
  then
  //here you could add something like:
  // print "The empty chat line was received" 1000
  0AC9: free_allocated_memory 4@
  0BE0: raknet hook_ret false
end
this way you'll know when admins wanted to clear the chat and what was there



Working perfectly, thank you bro :)
 
Status
Not open for further replies.
Top