Raised This Month: $32 Target: $400
 8% 

PrintToConsole Queued (Framed) - lines mix prevention


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 01-26-2022 , 14:48   PrintToConsole Queued (Framed) - lines mix prevention
Reply With Quote #1

Sometimes you may want to print lot of lines in client console.
But, the result is very often mixed and torned by the engine (at least in L4D, not sure about other games).

Below method is not 100% guarantee the lines will be always in correct order.
However, in most cases it is.

Each PrintToConsole command has auto-splitted between different frames, so the output looks fine.

PS. One simple walkaround could be concatenating all lines in a single variable using \n
However, the max buffer per command is like ~254 characters length.
So, if you have more data to output, these methods may be helpful for you:

Method #1.

Spoiler


Method #2

Sometimes you may want to print one very huge line.
Below technique allows you to split it by delimiter you specified and print without mixing/torning:

Spoiler


Unfortunately, such method doesn't help for PrintToChat commands, which mirroring output to a console.

Good luck and have fun!
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 01-26-2022 at 14:50.
Dragokas is offline
Gold Fish
Senior Member
Join Date: Mar 2020
Old 01-27-2022 , 06:16   Re: PrintToConsole Queued (Framed) - lines mix prevention
Reply With Quote #2

Limiting the length of the string in the chat stands on the client side?
__________________
-

PHP Code:
public OnClientConnect(int Client) {
    
KickClient(Client"sorry");

Gold Fish is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 01-27-2022 , 13:42   Re: PrintToConsole Queued (Framed) - lines mix prevention
Reply With Quote #3

Thanks for the guide Dragokas, I had to use that kind of solution once already, since I usually output my plugin configs to the console, and depending on the plugin, may have a lot of info.
__________________
Marttt is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode