Garry's Mod Wiki

GM:CanUndo

boolean GM:CanUndo( Player ply, table undo )

Description

Called whenever a players tries to undo.

Arguments

1 Player ply
The player who tried to undo something.
2 table undo
The undo table as a Structures/Undo.

Returns

1 boolean
Return false to disallow the undo.

Example

Here's a trick you can do to achieve the behavior of this function on the client.

hook.Add( "PlayerBindPress", "CanUndo", function( ply, bind ) if ply == LocalPlayer() and bind == "gmod_undo" then return true -- false to allow, true to prevent end end )

Page Links


Special Pages


Wikis

?

Render Time: 90ms

DB GetPage 54
Generate Html 11
SaveChanges (1) 17
Render Body 0
Render Sidebar 6