GM:OnUndo

From Garry's Mod
Jump to: navigation, search
 GM:OnUndo( )

Contents

Description

Called when the player undoes something.

Arguments

string name

The name of the undo action

Arguments

string customText

The custom text for the undo, set by undo.SetCustomUndoText

Examples

Example

Print a message when the player undoes something.

function GM:OnUndo( name, customText )
     if customText != nil then
          MsgN( "Undone " .. customText )
     else
          MsgN( "Undone " .. name )
     end
end

Output:

Undone <action>
Personal tools
Navigation