Source2Toolkit
Core api

IToolkitEvents

IToolkitEvents

Methods

HookGameEvent(owner, pchName, handler, post)

Registers a listener for a game event.

Parameters
  • owner PluginId — Plugin ID that owns the listener
  • pchName const char* — Event name (e.g. "player_death")
  • handler GameEventHandler — Callback function
  • post bool — false to be called before the engine processes the event,

UnhookGameEvent(owner, pchName, post)

Drops one of this plugin's event hooks.

Parameters
  • owner PluginId — Plugin ID that owns the listener
  • pchName const char* — Event name the hook was registered under
  • post bool — Which of the two hooks to drop

On this page