Garry's Mod Wiki

Revision Difference

GM:OnUndo#511131

<function name="OnUndo" parent="GM" type="hook">⤶ <ishook>yes</ishook>⤶ <description>Called when the player undoes something.</description>⤶ <realm>Client</realm>⤶ <predicted>No</predicted>⤶ <args>⤶ <arg name="name" type="string">The name of the undo action</arg>⤶ <arg name="customText" type="string">The custom text for the undo, set by &lt;page&gt;undo.SetCustomUndoText&lt;/page&gt;</arg>⤶ </args>⤶ </function>⤶ ⤶ <example>⤶ <description>Print a message when the player undoes something.</description>⤶ <code>⤶ function GM:OnUndo( name, customText )⤶ if customText != nil then⤶ MsgN( "Undone " .. customText )⤶ else⤶ MsgN( "Undone " .. name )⤶ end⤶ end⤶ </code>⤶ <output>Undone &amp;lt;action&amp;gt;</output>⤶ ⤶ </example>