Garry's Mod Wiki

MsgC

  MsgC( ... )

Description

Just like Msg, except it can also print colored text, just like chat.AddText.

Arguments

1 vararg args
Values to print. If you put in a color, all text after that color will be printed in that color.

Example

Prints Hello World! in red to the console.

MsgC( Color( 255, 0, 0 ), "Hello World!" )
Output:

Example

Displays the built-in colors for the three realms (client, server and menu).

MsgC( Color( 156, 241, 255, 200 ), "Server message color\n" ) MsgC( Color( 136, 221, 255, 255 ), "Server error color\n" ) MsgC( Color( 255, 241, 122, 200 ), "Client message color\n" ) MsgC( Color( 255, 221, 102, 255 ), "Client error color\n" ) MsgC( Color( 100, 220, 100, 200 ), "Menu message color\n" ) MsgC( Color( 120, 220, 100, 255 ), "Menu error color\n" )
Output:
image.png