notification.AddLegacy

From Garry's Mod
Jump to: navigation, search
 notification.AddLegacy( )

Contents

Description

Adds a standard notification to your screen.

Arguments

string text

The text to display.

Arguments

number type

Determines the notification method (e.g. icon) for displaying the notification. See the NOTIFY_ Enums.

Arguments

number length

The number of seconds to display the notification for.

Examples

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.
Personal tools
Navigation