API reference
Every interface, type and macro a plugin gets from the Source2Mod SDK, generated from the SDK headers.
This reference is generated from the headers in
source2mod-sdk/public
every hour, so it always matches the SDK on main. The guides in the other sections
explain how the pieces fit together; this is where the exact signatures live.
How a plugin reaches the API
Every interface is a pure-virtual class the core implements. SOURCE2MOD_SAVEVARS() in
your Load() fills one global per interface, so after that you call them directly:
g_pSource2ModCommands->RegisterConCommand("sm_hello", handler); // whose handler it is, the core reads off it
g_pSource2ModScheduler->NextFrame([] { /* ... */ });
auto pfnSetModel = ADDR_SET_MODEL(); // resolved engine functionEach page lists the interface id and the global it lives in, next to a link to the header.
Sections
Plugin
The plugin interface, the API object handed to Load(), and shared types like Action and HookChain.
Gameplay
Commands, ConVars, events, entities, menus, custom HUD, net messages, sounds, transmit, tracing, scheduler.
Engine
Resolved engine functions, KHook macros, gamedata, game systems, memory, modules and the schema system.
Services
HTTP, JSON, MySQL and resolved paths.
Reading the pages
- Types lists the aliases a header declares — callback signatures and function
pointer types such as the
*_treturned byISource2ModAddresses. - Methods gives the exact declaration, then the parameters with their types and, where the header documents them, what they mean.
- Types that have a page of their own are links; schema classes link into the Schema section.