Gamemode.AddNotify

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NameAddNotify
SyntaxGM:AddNotify( String Message, Number Type, Integer Duration )
DescriptionSends a notice to the player
ReturnsNil
Lua StateNewerClient.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.AddNotify]Gamemode.AddNotify [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionDisplays the notification "Obey the rules" on the screen for 5 seconds with the generic icon in front of it.
Used onNewerClient.png
Code
GAMEMODE:AddNotify("Obey the rules.", NOTIFY_GENERIC, 5);
OutputExampleNotify.jpg
DescriptionAllows the notification to be sent to a client from the server.
Used onNewerServer.png
Code
ply:SendLua("GAMEMODE:AddNotify(\"Obey the rules.\", NOTIFY_GENERIC, 5)")
Tip:
Notice how \" can be used to place speech marks within strings.
OutputExampleNotify.jpg
Hintall.png


List of Types

Icons are shown in the image on the right:

CLIENT | 0 | 0000 | NOTIFY_GENERIC
CLIENT | 1 | 0001 | NOTIFY_ERROR
CLIENT | 2 | 0010 | NOTIFY_UNDO
CLIENT | 3 | 0011 | NOTIFY_HINT
CLIENT | 4 | 0100 | NOTIFY_CLEANUP

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox