s2script

A fast TypeScript framework for CS2 plugins.

Plugin ecosystem, built-in crash reporting, and SourceMod-shaped APIs — all in one stack.

 

A plugin is a TypeScript module

Export OnPluginStart, register commands and event hooks, and build a .s2sp with s2s build.

import { command, hook, HookResult, Chat } from '@s2script/sdk';
import { Player } from '@s2script/cs2';

export function OnPluginStart(): void {
	command('hello', (cmd) => {
		cmd.reply(`hi from slot ${cmd.callerSlot}`);
		return HookResult.Handled;
	});

	hook.on('player_spawn', (ev) => {
		const player = Player.fromSlot(ev.getPlayerSlot('userid'));
		if (player) Chat.toSlot(player.slot, 'Welcome!');
	});
}

Coming from another framework? SourceModCounterStrikeSharpModSharpSwiftly

  • Typed game API

    Entities, schema fields, game events, commands and HUD, all with TypeScript types generated from the game itself.

    Browse the API →
  • Hot reload

    Drop a .s2sp into the plugins folder to load it, replace it to reload, delete it to unload. State can carry across reloads.

    Plugin lifecycle →
  • Package registry

    Publish plugins and build-time libraries with the s2s CLI, and install community packages with their dependencies.

    Publishing guide →
  • Faultline crash reports

    Opt in and your server uploads crashes, including JS errors and minidumps. Owners read stacks, loaded plugins and dumps on this site.

    Open Faultline →