Schema

Entity classes, enums and engine structures, generated from the game's own schema and the SDK headers.

Counter-Strike 2 describes its networked classes to itself through the schema system: every class, its parent and every field with its offset. The SDK turns a dump of that schema into C++ classes, so pawn->m_iHealth() resolves the offset at runtime from the schema the running game ships — it keeps working after an update that moves fields around.

What is here

Using a field

CCSPlayerPawn* pawn = controller->GetPlayerPawn();

int health = pawn->m_iHealth();   // read
pawn->m_iHealth = 150;            // write -- also marks the field for networking

Reads and writes go through accessors that look the offset up once and cache it. Writing a networked field notifies the engine, so clients see the change without you calling NetworkStateChanged yourself. The Entities section covers finding entities, helpers and when a manual state change is still needed.

Helper methods

Next to the generated fields, many classes carry hand-written helpers — SetModel, Teleport, GiveNamedItem, SwitchTeam, TakeDamage, … Helpers that call a hookable game function take a last HookChain argument: HookChain::Run goes through every plugin's hooks as if the game made the call, HookChain::Bypass calls the original directly. See HookChain.

On this page