Garry's Mod Wiki

GM:AcceptInput

boolean GM:AcceptInput( Entity ent, string input, Entity activator, Entity caller, any value )

Description

Called when a map I/O event occurs.

See also Entity:Fire and Entity:Input for functions to fire Inputs on entities.

Arguments

1 Entity ent
Entity that receives the input
2 string input
The input name. Is not guaranteed to be a valid input on the entity.
3 Entity activator
Activator of the input
4 Entity caller
Caller of the input
5 any value
Data provided with the input. Will be either a string, a number, a boolean or a nil.

Returns

1 boolean
Return true to prevent this input from being processed.

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 )

Page Links


Special Pages


Wikis

?

Render Time: 31ms

Session 0
DB GetPage 2
Generate Html 6
SaveChanges 9
Render Body 0
Render Sidebar 11