GM/AcceptInput

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Undo revision 31522 by Robotboy655 (talk))
Line 14: Line 14:
 
|type=string
 
|type=string
 
|name=input
 
|name=input
|desc=The input name
+
|desc=The input name. Is not guaranteed to be a valid input on the entity.
 
}}
 
}}
 
{{Arg
 
{{Arg

Revision as of 14:19, 25 January 2019

 GM:AcceptInput( )

Contents

Description

Called when a map I/O event occurs.

See also Entity:Fire and Entity:Input.

Arguments

Entity ent

Entity that receives the input

Arguments

string input

The input name. Is not guaranteed to be a valid input on the entity.

Arguments

Entity activator

Activator of the input

Arguments

Entity caller

Caller of the input

Arguments

any value

Data provided with the input. Will be either a string, a number, a boolean or a nil.

Returns

boolean

Return true to prevent this input from being processed.

Examples

Example

This would block any input that the lua_run entity would receive.

hook.Add( "AcceptInput", "BlockLuaRun", function( ent, name, activator, caller, data )
    if ( ent:GetClass() == "lua_run" ) then
        return true
    end
end )


Personal tools
Navigation