# Getting started

s2script is a TypeScript plugin runtime for Source 2 games (Counter-Strike 2 first), loaded via Metamod:Source. The live runtime is **CS2 on `linuxsteamrt64` only**.

## Prerequisites

1. A Counter-Strike 2 dedicated server (Linux x86-64 / `linuxsteamrt64`).
2. Stock [Metamod:Source](https://www.sourcemm.net/) with plugin API (PLAPI) 18 support, installed under `game/csgo/addons/metamod/`. No patched or custom Metamod host is required; a compatible official upstream release is fine if you confirm PLAPI for that release and every other native plugin on the server.
3. Custom Panorama HUD also needs [MultiAddonManager](https://github.com/Source2ZE/MultiAddonManager) **v1.6.1 or later**. v1.6 is stale for CS2 builds 25515854+: the addon-list offset does not match, so clients never mount the HUD addon. See [HUD](https://s2script.com/docs/concepts/hud).

## Install the runtime

1. Download the latest `s2script-cs2-linux-*.zip` from the [Download](https://s2script.com/download) page (or GitHub Releases).
2. Extract into `game/csgo/` so `addons/` overlays in place. That creates a SHA-256–verified CS2 **game package** under `addons/s2script/`:

```text
addons/s2script/
  bin/linuxsteamrt64/s2script.so
  bin/linuxsteamrt64/libs2script_core.so
  game-packages.json
  game-packages/cs2/index.js
  game-packages/cs2/gamedata.json
  game-packages/cs2/trusted-functions.json
  gamedata/core/
  gamedata/sdkhooks/
  plugins/
```

`game-packages.json` is selected-package metadata plus artifact hashes. The native shim (`s2script.so`) and core (`libs2script_core.so`) **must ship as a pair** — replace the whole zip rather than mixing versions.

Operator overrides still live in `addons/s2script/gamedata/cs2/custom/` and apply **after** the verified package data (acquire, HUD-click, and damage signature repairs included). Every repair is reported at boot. Shipped game files are no longer loaded from `gamedata/cs2/` or `js/pawn.js`; there is no prelude-by-path fallback.

3. Patch `gameinfo.gi` so Metamod is the first SearchPath:

```text
Game    csgo/addons/metamod
```

4. Ensure `addons/s2script/configs` and `addons/s2script/data` are writable.
5. Restart the server and confirm with `meta list`.

The native s2script shim stays resident during gameplay. `.s2sp` plugins still hot-reload inside s2script; stop and restart the server for native shim or Metamod updates.

Operators can bound native async admission with `S2SCRIPT_ASYNC_LIMITS_JSON` before starting the process — [Async & networking](https://s2script.com/docs/concepts/async#async-limits).

## Base plugins

The release zip includes the SourceMod-parity suite (basecommands, basechat, playercommands, antiflood, adminhelp, basecomm, basebans, reservedslots, basetriggers, funcommands, clientprefs, adminmenu, basevotes, zones).

First adoption of the versioned cookie schema needs matched core and [clientprefs](https://s2script.com/plugins/clientprefs) artifacts installed with the server stopped, then a fresh process. Do not hot-load a newer clientprefs over an older generation with unversioned cookie writes still in flight. clientprefs is the sole cookie-table writer — see [Cookies](https://s2script.com/docs/concepts/cookies).

Opt-in plugins (nominations, rockthevote, nextmap, funvotes) live under `plugins/disabled/` — the loader's non-recursive scan skips that subdirectory. To enable one, move its `.s2sp` up one level into `addons/s2script/plugins/`.

## Next

- Coming from another framework: [SourceMod](https://s2script.com/docs/migrating/sourcemod), [CounterStrikeSharp](https://s2script.com/docs/migrating/counterstrikesharp), [ModSharp](https://s2script.com/docs/migrating/modsharp), [Swiftly](https://s2script.com/docs/migrating/swiftly)
- [Authoring plugins](https://s2script.com/docs/authoring)
- [Plugin lifecycle](https://s2script.com/docs/concepts/lifecycle)
- [HUD (CS2 Panorama)](https://s2script.com/docs/concepts/hud)
- [Custom camera](https://s2script.com/docs/concepts/camera)
- [Browse plugins](https://s2script.com/plugins)
- [Package reference](https://s2script.com/docs/api/packages)
