ENT.AcceptInput

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NameAcceptInput
SyntaxENT:AcceptInput( String name, Entity activator, Entity caller, String data )
DescriptionCalled when an input is triggered.
ReturnsBoolean
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=ENT.AcceptInput]ENT.AcceptInput [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionIf the input is lolinput, prints the name of the caller
Used onNewerServer.png
Code
 
function ENT:AcceptInput( name, activator, caller, data )
    if (name == "lolinput") then 
        if ( caller:IsPlayer() ) then
            print( caller:Nick() )
        else
            print( caller:GetClass() )
        end
    end
end
 
OutputIf you used lolinput, the message would be printed into the console.


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox