Modules
Generated API reference for @s2script/sdk subpaths and @s2script/cs2. See also the package reference.
- Config @s2script/sdk/config Platform
typed access to the plugin's materialized config.
- Console @s2script/sdk/console Platform
Injected console logging for plugins.
- Entity @s2script/sdk/entity Platform
Liveness-gated EntityRef handles, typed reads/writes, create/spawn/teleport/remove, and entity I/O.
- Interfaces @s2script/sdk/interfaces Platform
publishInterface / consumer proxies for typed, versioned cross-plugin interfaces.
- Math @s2script/sdk/math Platform
Vector and QAngle value types plus helpers like forwardVector.
- Plugin @s2script/sdk/plugin Platform
the typed plugin artifact: `plugin(factory)`, the load-scoped `PluginContext`, and `Scope`.
- Plugins @s2script/sdk/plugins Platform
runtime plugin management (the SM `sm plugins` backend).
- Timers @s2script/sdk/timers Platform
Tick-integrated async timing: delay, nextTick, nextFrame, threadSleep.
- Clients @s2script/sdk/clients Players & world
engine-generic client handle + lifecycle events. Resolved at runtime via globalThis.__s2pkg_clients. Import: import { Client, Clients } from "./clients";
- Damage @s2script/sdk/damage Players & world
damage pre-hooks (SDKHooks-equivalent).
- Events @s2script/sdk/events Players & world
Typed game-event bus: fire / fireToClient, HookResult, and the block-scoped GameEvent accessor.
- Sound @s2script/sdk/sound Players & world
engine-generic sound: emit a named SoundEvent + register custom precache paths.
- Trace @s2script/sdk/trace Players & world
Ray / line / hull traces returning a liveness-gated hit entity.
- Transmit @s2script/sdk/transmit Players & world
per-client entity visibility filtering (Source2 CheckTransmit). Declarative rules: a plugin says "this entity is visible only to these viewer slots" and the engine-side hook enforces it every snapshot — zero JS runs in the per-client hot path.
- User Commands @s2script/sdk/usercmd Players & world
a SourceMod `OnPlayerRunCmd`-equivalent: intercept, read, modify, and block a player's per-tick input (buttons, view angles, movement, impulse) before the game processes it.
- User Messages @s2script/sdk/usermessages Players & world
A general protobuf user-message builder.
- Admin @s2script/sdk/admin Admin & chat
engine-generic admin flag model + cache API. Resolved at runtime via `globalThis.__s2pkg_admin`; no game-specific symbols. Import: `import { ADMFLAG, Admin } from "./admin";`
- Bans @s2script/sdk/bans Admin & chat
engine-generic SteamID64 ban store + bans.json persistence. Resolved at runtime via `globalThis.__s2pkg_bans`; no game-specific symbols. Import: `import { Bans } from "./bans";` The store is host-global in core, populated from `addons/s2script/configs/bans.json` via the config bridge. Enforcement is JS-driven: a ban plugin (e.g. @s2script/basebans) registers a `Clients.onConnect` handler that looks a connecting SteamID64 up here and, if banned, shows the reason then kicks (`Client.kickWithReason`) — a banned player is admitted, shown their reason, and kicked, not instant-rejected. A 3rd-party ban system registers its own onConnect against its own store.
- Chat @s2script/sdk/chat Admin & chat
print messages to player chat.
- Commands @s2script/sdk/commands Admin & chat
Console + chat command registration: register / registerServer / registerAdmin.
- Menu @s2script/sdk/menu Admin & chat
interactive player menus (chat + center backends).
- Server @s2script/sdk/server Admin & chat
Server.command, cvars, map validity, and onMapStart.
- TopMenu @s2script/sdk/topmenu Admin & chat
the extensible admin/top menu registry.
- Translations @s2script/sdk/translations Admin & chat
SourceMod-style i18n (per-client language, phrase files, {1} formatting).
- Votes @s2script/sdk/votes Admin & chat
chat-ballot voting with revote + an optional live center tally.
- Cookies @s2script/sdk/cookies Persistence
SM-parity client preference cookies.
- Database @s2script/sdk/db Persistence
engine-generic async SQLite database.
- HTTP @s2script/sdk/http Network
async HTTP.
- Sockets @s2script/sdk/net Network
engine-generic raw TCP + UDP sockets (binary), off the game thread.
- WebSocket @s2script/sdk/ws Network
client WebSocket.
- CS2 @s2script/cs2 Game CS2
CS2 player/pawn model, schema accessors, typed events overlay, menus, and Fade/Shake/HintText.