Garry's Mod Wiki

History for GM:CanUndo

Revision Difference

GM:CanUndo#527796

<function name="CanUndo" parent="GM" type="hook"> <ishook>yes</ishook> <description>Called whenever a players tries to undo.</description> <realm>Server</realm> <args> <arg name="ply" type="Player">The player who tried to undo something</arg> <arg name="undo" type="table">The undo table as a <page>Structures/Undo</page></arg> <arg name="ply" type="Player">The player who tried to undo something.</arg> <arg name="undo" type="table">The undo table as a <page>Structures/Undo</page>.</arg> </args> <rets> <ret name="" type="boolean">Return false to disallow the undo</ret> <ret name="" type="boolean">Return false to disallow the undo.</ret> </rets> </function> <example> <description> Here's a trick you can do to achieve the behavior of this function on the client. </description> <code> hook.Add("PlayerBindPress", "CanUndo", function(ply, bind) 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) end ) </code> </example>

Special Pages


Wikis

?

Render Time: 36ms

DB GetPage 24
Get RevNew 1
Get RevOld 1
Render Body 0
Render Sidebar 7