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 function

Each page lists the interface id and the global it lives in, next to a link to the header.

Sections

Reading the pages

  • Types lists the aliases a header declares — callback signatures and function pointer types such as the *_t returned by ISource2ModAddresses.
  • 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.

On this page