numpad/Register

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(library function)
(This example is gibberish)
Line 15: Line 15:
 
|name=func
 
|name=func
 
|desc=The function to be executed.
 
|desc=The function to be executed.
}}
 
{{Example
 
| Description = Demonstrates the use of this function.
 
| Code = numpad.Register("my_action", function(ply, arg1) print(ply, arg1) end
 
ents.FindByClass( "prop_physics" )[1].myAct = numpad.OnDown(player.GetByID(1), 38, "my_action", "arg1")
 
| Output = When player 1 presses his Numpad 1 key, something like this will be printed in console: "Player [1][Robot] arg1"
 
 
}}
 
}}

Revision as of 07:52, 30 March 2013

 numpad.Register( )

Description

Registers a numpad library action for use with numpad.OnDown and numpad.OnUp

Arguments

string id

The unique id of your action.

Arguments

function func

The function to be executed.
Personal tools
Navigation