Garry's Mod Wiki

Revision Difference

numpad.Register#516997

<function name="Register" parent="numpad" type="libraryfunc"> <description>Registers a numpad library action for use with <page>numpad.OnDown</page> and <page>numpad.OnUp</page></description> <realm>Server</realm> <args> <arg name="id" type="string">The unique id of your action.</arg> <arg name="func" type="function">The function to be executed.&#xA;&#xA;Arguments are:&amp;amp;lt;br&amp;amp;gt;&#xA;&lt;page&gt;Player&lt;/page&gt; ply - The player who pressed the button&amp;amp;lt;br&amp;amp;gt;&#xA;&lt;page&gt;vararg&lt;/page&gt; ... - The 4th and all subsequent arguments passed from &lt;page&gt;numpad.OnDown and/or {{LibraryFunction|numpad|OnUp&lt;/page&gt;</arg> <arg name="func" type="function">The function to be executed.&#xA;&#xA;Arguments are:&amp;amp;lt;br&amp;amp;gt;&#xA;&lt;page&gt;Player&lt;/page&gt; ply - The player who pressed the button&amp;amp;lt;br&amp;amp;gt;&#xA;&lt;page&gt;vararg&lt;/page&gt; ... - The 4th and all subsequent arguments passed from &lt;page&gt;numpad.OnDown and/or {{LibraryFunction|numpad|OnUp&lt;/page&gt;&amp;amp;lt;br&amp;amp;gt;&#xA;&amp;amp;lt;br&amp;amp;gt;&#xA;&#xA;Returning **false** in this function will remove the listener which triggered this function (example: return false if one of your varargs is an entity which is no longer valid)</arg> </args> </function> ⤶ <br/>⤶ <br/>⤶ ⤶ Returning **false** in this function will remove the listener which triggered this function (example: return false if one of your varargs is an entity which is no longer valid)⤶ }}