Garry's Mod Wiki

notification.AddLegacy

  notification.AddLegacy( string text, number type, number length )

Description

Adds a standard notification to your screen.

Arguments

1 string text
The text to display.
2 number type
Determines the notification method (e.g. icon) for displaying the notification. See the NOTIFY enum.
3 number length
The number of seconds to display the notification for.

Example

Adds a prop undo notification to the screen, like in Sandbox.

notification.AddLegacy( "Undone Prop", NOTIFY_UNDO, 2 ) surface.PlaySound( "buttons/button15.wav" ) Msg( "Prop undone\n" )
Output: Adds a notice that says Undone Prop, plays the undo sound, and adds a message to the console.
image.png