Garry's Mod Wiki

Revision Difference

GM:OnCleanup#527379

<cat>hook</cat>⤶ <function name="OnCleanup" parent="GM" type="hook">⤶ <ishook>yes</ishook>⤶ <description>Called when the player cleans up something.</description>⤶ <realm>Client</realm>⤶ <predicted>No</predicted>⤶ <file line="52">gamemodes/sandbox/gamemode/cl_init.lua</file>⤶ <args>⤶ <arg name="name" type="string">The name of the cleanup type</arg>⤶ </args>⤶ <rets>⤶ <ret name="suppress" type="boolean">Return false to suppress the cleanup notification.</ret>⤶ </rets>⤶ </function>⤶ ⤶ <example>⤶ <description>Print a message when the player cleans up something.</description>⤶ <code>⤶ hook.Add( "OnCleanup", "PrintCleanupMessage", function( name )⤶ print( "Cleaned up " .. name ) ⤶ end )⤶ </code>⤶ <output>Cleaned up &lt;type&gt;</output>⤶ ⤶ </example>