Player.PrintMessage

From GMod Wiki

Jump to: navigation, search
Function
Syntax Player:PrintMessage( Number type, String message )
Description:
Prints a message to user in various places.
Returns: nil
In Object: Player
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.PrintMessage]Player.PrintMessage [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionPrints "Hi There!" in player 1's chat.
Used onNewerServer.png
Code
player.GetByID( 1 ):PrintMessage( HUD_PRINTTALK, "Hi There!" )
OutputHi There!


DescriptionPrints User's name and team of id 1 accross center screen.
Used onNewerServer.png
Code
local name = player.GetByID( 1 ):GetName()
local message = "Player " .. name .. "connected: " .. player.GetByID( 1 ):TimeConnected()
player.GetByID( 1 ):PrintMessage( HUD_PRINTCENTER, message )
OutputPlayer Garry connected: 21:50


Types

SHARED | 0000000000000001 | 00000000000000001 | HUD_PRINTCENTER - Prints to the center of the client's screen
SHARED | 0000000000000002 | 00000000000000010 | HUD_PRINTCONSOLE - Prints to the client's console
SHARED | 0000000000000003 | 00000000000000011 | HUD_PRINTNOTIFY - Same as HUD_PRINTCONSOLE
SHARED | 0000000000000004 | 00000000000000100 | HUD_PRINTTALK - Prints to the chat area

Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox