GM/AcceptInput

From Garry's Mod
Jump to: navigation, search
 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