Global/Msg

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m (Also menu state)
(added note about newlines not being added, probably needs to be phrased better but I dunno how)
Line 1: Line 1:
 
{{Func
 
{{Func
|Description=Writes every given argument to the console.<br />
+
|Description=Writes every given argument to the console.
Automatically attempts to convert each argument to a string. (See {{GlobalFunction|tostring}})<br />
+
 
 +
Automatically attempts to convert each argument to a string. (See {{GlobalFunction|tostring}})
 +
 
 
Unlike {{GlobalFunction|print}}, arguments are not separated by anything. They are simply concatenated.
 
Unlike {{GlobalFunction|print}}, arguments are not separated by anything. They are simply concatenated.
 +
 +
Additionally, a newline isn't added automatically to the end, so subsequent Msg or print operations will continue the same line of text in the console. See {{GlobalFunction|MsgN}} for a version that does add a newline.
  
 
The text is blue on the server and orange on the client: [[File:msg server client colors.png]]
 
The text is blue on the server and orange on the client: [[File:msg server client colors.png]]
 
|Realm=Shared and Menu
 
|Realm=Shared and Menu
 
|IsClass=No
 
|IsClass=No
|Name=Msg
 
|Parent=Global
 
 
}}
 
}}
 
{{Arg
 
{{Arg

Revision as of 21:12, 23 July 2018

 Msg( )

Contents

Description

Writes every given argument to the console.

Automatically attempts to convert each argument to a string. (See tostring)

Unlike print, arguments are not separated by anything. They are simply concatenated.

Additionally, a newline isn't added automatically to the end, so subsequent Msg or print operations will continue the same line of text in the console. See MsgN for a version that does add a newline.

The text is blue on the server and orange on the client: msg server client colors.png

Arguments

vararg args

List of values to print.

Examples

Example

Prints "Hello World!" to the console.

Msg("Hello", " World!")

Output:

Hello World!
Personal tools
Navigation