Garry's Mod Wiki

GM:OnUndo

boolean GM:OnUndo( string name, string customText )

Description

Called when the player undoes something.

Arguments

1 string name
The name of the undo action
2 string customText
The custom text for the undo, set by undo.SetCustomUndoText

Returns

1 boolean suppress
Return false to suppress the undo notification.

Example

Print a message when the player undoes something.

hook.Add( "OnUndo", "CustomUndoText", function( name, customText ) if customText ~= nil then MsgN( "Undone " .. customText ) else MsgN( "Undone " .. name ) end end )
Output: Undone <action>

Page Links


Special Pages


Wikis

?

Render Time: 97ms

DB GetPage 63
Generate Html 11
SaveChanges (1) 15
Render Body 0
Render Sidebar 6