Garry's Mod Wiki

Revision Difference

notification.AddLegacy#510678

<function name="AddLegacy" parent="notification" type="libraryfunc">⤶ <description>Adds a standard notification to your screen.</description>⤶ <realm>Client and Menu</realm>⤶ <args>⤶ <arg name="text" type="string">The text to display.</arg>⤶ <arg name="type" type="number">Determines the notification method (e.g. icon) for displaying the notification. See the &lt;page&gt;NOTIFY&lt;/page&gt;.</arg>⤶ <arg name="length" type="number">The number of seconds to display the notification for.</arg>⤶ </args>⤶ </function>⤶ ⤶ <example>⤶ <description>Adds a prop undo notification to the screen, like in Sandbox.</description>⤶ <code>⤶ notification.AddLegacy( "Undone Prop", NOTIFY_UNDO, 2 )⤶ surface.PlaySound( "buttons/button15.wav" )⤶ Msg( "Prop undone\n" )⤶ </code>⤶ <output>Adds a notice that says "Undone Prop", plays the undo sound, and adds a message to the console.</output>⤶ ⤶ </example>