View Single Post
MAGNAT2645
Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
Old 08-14-2020 , 11:44   Re: Hook one entity button
Reply With Quote #2

You can HookEntityOutput (for every entity of the same class):
Code:
HookEntityOutput( "func_button", "OnPressed", MyCallback ); // hooks "OnPressed" output for every entity with "func_button" classname
or HookSingleEntityOutput (for specific single entity):
Code:
HookSingleEntityOutput( iEntity, "OnPressed", MyCallback, true ); // hooks specific iEntity (index) and calls MyCallback only once (last boolean argument) when entity fires "OnPressed" output
Outputs for func_button.
__________________

Last edited by MAGNAT2645; 08-14-2020 at 11:46.
MAGNAT2645 is offline