AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   PrintToConsole Queued (Framed) - lines mix prevention (https://forums.alliedmods.net/showthread.php?t=336087)

Dragokas 01-26-2022 14:48

PrintToConsole Queued (Framed) - lines mix prevention
 
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!

Gold Fish 01-27-2022 06:16

Re: PrintToConsole Queued (Framed) - lines mix prevention
 
Limiting the length of the string in the chat stands on the client side?

Marttt 01-27-2022 13:42

Re: PrintToConsole Queued (Framed) - lines mix prevention
 
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.


All times are GMT -4. The time now is 22:42.

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