Изменения

Все релизы amxts: фреймворк, CLI, официальные модули и расширение для редактора.
amxts

v0.3.6

v0.3.6 is the next patch release.

📣 Some news

📦 Installing from npm works again

@amxts/core@0.3.5 was published broken: npm install failed on it. It is deprecated now, and 0.3.6 replaces it.

👀 Highlights

🗂️ Plugins in folders

The top of plugins/ holds the plugins and every subfolder holds code. Now amxts.config.ts can name more folders of plugins. A folder can also give its plugins a name prefix on the server:

export default defineConfig({
    plugins: ["modules", { path: "games", prefix: "minigame_" }],
    dir: { api: "api" },
});
plugins/
├── core.ts        # plugin → core.aot
├── core/          # core.ts's code, not plugins
├── games/
│   └── hns.ts     # plugin → minigame_hns.aot
├── modules/
│   └── duel.ts    # plugin → duel.aot, runs api/duel.ts
└── api/
    └── duel.ts    # shared with every plugin: import * as duel from "~/api/duel"

dir.api keeps the modules your plugins share in a folder of your choice, modules/ by default. A module's plugin can sit in any folder of plugins, a prefixed one too, and the other plugins' calls find it there. Two files that come to one .aot name stop the build. A project without these keys builds as before.

🩹 Important fixes

  • A plugin that calls a module of your project is built again when that module's API changes. Before, the build could take it from its cache, and on the server every call answered 0 with "built from another version of it - build both again" (a304b5a).
  • player.kill() works in your tests: on the fake server the player stayed alive, since it did not run fakemeta's set_pev and the game's death (7d7b835).

✅ Upgrading

Update the CLI with your project's own package manager, then:

npx amxts upgrade

👉 Changelog

compare changes

🚀 Enhancements

  • project: Plugins in folders the config names (a3d78eb)

🩹 Fixes

  • build: Rebuild a module's callers when its API changes (a304b5a)
  • testing: player.kill() on the fake server (7d7b835)

📖 Documentation

  • The v0.3.5 changelog's userinfo heading (061bb65)
  • What 0.3.5 changed for a plugin author (b61102d)

❤️ Contributors

📦 Files

  • amxts-server-windows-x64.zip, amxts-server-linux-x64.tar.gz - the server kit: the module and an example plugin, hello.aot.
  • amxts_amxx.dll, amxts_amxx_i386.so - the module alone.
  • wamrc-* - WAMR's AOT compiler, per system, which @amxts/wamrc-<system> carries for npx amxts build.
  • amxts-windows.json, amxts-linux.json - what each was built from, with every file's sha256.
perms

v0.2.1

For the 0.3 line of the core.

🩹 Important fixes

  • A hot reload of a plugin that declares permissions printed "X is declared twice" for each of them, and a declaration that changed in the reload was not taken. A plugin's declarations now go with it when it stops (6d3f491).
  • A plugin that asked for a permission while perms was being hot-reloaded, before perms had read its file, stopped perms with "Unexpected 'null'". The default group now exists from the start, so the answer is the default group's until the file is read (6d9fd57).

👉 Changelog

compare changes

🩹 Fixes

  • Forget a stopped plugin's declared nodes (6d3f491)
  • Guard against null user fields during a reload (a70a008)
  • Default group exists before the config is read (6d9fd57)

❤️ Contributors

resemiclip

v0.2.2

For the 0.3.5 core and the later cores of the 0.3 line.

💣 Grenades fly through partners

A grenade one partner threw bounced off the other. Now it flies through the partners of the player who threw it, on every server, with ReHLDS and ReGameDLL or without them.

🧍 Standing on a head

A player who jumped on a partner's head fell through him. Now a player wholly above a partner stands on him, and each sees the other whole while he does. Two who are already in each other still pass, so nobody gets stuck.

Both are on, and the project turns them off in amxts.config.ts:

export default defineConfig({
    modules: ["@amxts/semiclip"],
    semiclip: {
        grenades: false,     // a grenade bounces off a partner of its thrower
        standOnHead: false,  // a partner above falls through
    },
});

🎮 Head boosts in one mode only

A plugin can turn standing on a head off for as long as it runs, so a server with several modes keeps head boosts in one and not in another:

semiclip.standOnHead = false; // while this plugin runs, a partner above falls through

When the plugin stops, the project's standOnHead comes back.

👻 The look, in the project's options

A partner fades out smoothly: he is whole at fadeDistance, as opaque as opacity at hideDistance, and closer than that he goes to nothing in a tenth of a second and comes back as you step away, instead of vanishing at once. He is blended as a whole, so a faint partner leaves no light outline. The module's look now hides him closer than 60 units instead of 48, and the project sets it in amxts.config.ts beside the rest, instead of a plugin setting the core's server.walkThroughLook:

export default defineConfig({
    modules: ["@amxts/semiclip"],
    semiclip: {
        fadeDistance: 250,  // closer than 250 units a partner is see-through
        opacity: 0.4,       // 40% opaque at hideDistance, whole at fadeDistance
        hideDistance: 60,   // closer than 60 units he fades out and is not drawn at all
    },
});

⚠️ Breaking changes

player.walksThrough and server.walkThroughLook left the core's plugin API in 0.3.5. A plugin asks who walks through whom with semiclip.rule, and the look is the project's semiclip: { ... }.

👉 Changelog

compare changes

🚀 Enhancements

  • Grenades and standing on a partner's head as options (92e6bec)
  • A partner hidden closer than 60 units (949d4f9)
  • ⚠️ The look in the project's options (8404254)
  • semiclip.standOnHead set by a plugin while it runs (431107d)

🩹 Fixes

  • Defer pair updates to the next frame (1d0c279)

💅 Refactors

  • The options through the core's kit (c15a2f3)

📖 Documentation

  • A partner fades out closer than hideDistance (3c785e6)

⚠️ Breaking Changes

  • ⚠️ The look in the project's options (8404254)

❤️ Contributors

menu-core

v0.3.2

For the 0.3 line of the core.

🩹 Important fixes

  • A menu file shared by several plugins, such as one file for every mode of a server, warned on every map about each name of a plugin that was not loaded: its actions, conditions and placeholders "not registered". Now only the menus a plugin uses are checked: those it registers, shows or opens with SHOW_<MENU>. A menu nobody uses stays quiet until a plugin uses it (25a5534).

👉 Changelog

compare changes

🩹 Fixes

  • menus: Check only the menus a plugin uses (25a5534)

❤️ Contributors

amxts

v0.3.5

v0.3.5 is a patch release of the 0.3 line, with one break: walking through each other is now the semiclip module's alone, so a plugin that set pairs or the look itself needs a change (below). Plugins built with 0.3.0 to 0.3.4 load on its module as they are; the new semiclip needs the 0.3.5 module, which npx amxts upgrade puts on your server.

👀 Highlights

🔁 entries(), keys(), values()

for...of over an array's entries() now compiles as plain TypeScript, and typed arrays have entries(), keys() and values() too:

for (const [i, name] of names.entries()) console.log(`${i}: ${name}`);

const bytes = new Uint8Array(4);
for (const i of bytes.keys()) bytes[i] = i;

👤 What each client is sent of a player

The new sendUserInfo game event hears a player's userinfo on its way to each client. Writing a key of event.info changes only what that client sees of the player, such as the name in the scoreboard and the kill notices. The player, the game and the other clients keep the real one, so nobody is renamed and the chat says nothing. player.info.resend() sends a player's userinfo to every client now. Both work with ReHLDS and on plain HLDS, on Linux and Windows.

let shown: Player | null = null;
let shownName = "";

game.addEventListener("sendUserInfo", (event) => {
    if (event.player == shown) event.info.set("name", shownName);
});

// "Killer + Assister" in the kill notice
shown = killer;
shownName = `${killer.name} + ${assister.name}`;
killer.info.resend();

🧰 For modules: walking through each other

The pairs and how partners pass and look are now the kit's, for a module that lets players walk through each other: walksThrough(player) is the players he walks through, as a Set, and setWalkThroughOptions sets the look up close, grenades passing a thrower's partners and standing on a partner's head - all off until a module turns them on. semiclip 0.2.2 is the module that offers them to a project.

import { setWalkThroughOptions, walksThrough } from "@amxts/core/kit";

walksThrough(player).add(teammate);
setWalkThroughOptions({ fadeDistance: 250, opacity: 0.4, hideDistance: 60, grenades: true, standOnHead: true });

🛠️ And more

  • In tests, server.advance(ms) runs the frames in between, so a server_frame listener is heard without a separate frame call. frameTime sets the frame's length (76bc6ed).

🩹 Important fixes

  • A UserMessage of a message the game registers with a fixed size, such as BuyClose, was not sent, and the console said the engine had not registered it. It is now the game's message, sent when exactly its size is written: new UserMessage("BuyClose").send(player) closes the player's buy menu (111f5c2).
  • On Valve's game, a bot that joined a side with joinTeam stayed in the game's joining state: its next commands opened the team menu and put it at the intro cameras. It is now in the game (1fc50fe).
  • A plugin that wrote into a message whose message_begin the engine refused, such as a message of its own with an id the server never registered, crashed the server ("PF_WriteString_I: called with no active message"). The begin is now refused with an error in the plugin, and the writes after it go nowhere (8d999e5).
  • Too many temporary entities to one player in a frame, such as beams, made the engine drop everything he was sent that frame, and nothing said why. The console now names the plugin that wrote the most (6b6a5ce).
  • "A timer held the frame" and "its async functions held the frame" now name the slowest function by file and line, as the listeners' lines do. A listeners' line also says how much of the time went to none of them (0ddbb09, 367ea41, 0f2875a).
  • A plugin that threw many errors, say a frame listener failing every frame, stopped working until the map changed: every later call failed, and the console printed only empty lines. Each failed call left a little of the plugin's stack taken. Now a plugin goes on after any number of errors. Rebuild your plugins with 0.3.5 to get it (f89b9db).

⚠️ Breaking changes

player.walksThrough and server.walkThroughLook are gone from the plugin API: who walks through whom is the semiclip module's, so a server has one owner of it. I took them out in a patch rather than wait for 0.4, so this update can break a plugin that used them:

0.3.40.3.5
player.walksThrough.add(other) in a pluginsemiclip.rule = (player, target) => ... of @amxts/semiclip
server.walkThroughLook = { fadeDistance, opacity, hideDistance } in a pluginsemiclip: { fadeDistance, opacity, hideDistance } in amxts.config.ts
a module of your own with player.walksThroughwalksThrough(player) from @amxts/core/kit

npx amxts upgrade does not rewrite these lines: the build names each one it cannot compile.

⚠️ What changes on your server

With ReGameDLL, a flash's light used to pass a partner. It now stops at him as at anyone, as it does in the game and on every other server.

✅ Upgrading

npm install -D @amxts/cli@latest   # pnpm add -D, yarn add -D, bun add -d
npx amxts upgrade

It moves @amxts/core to 0.3.5 and @amxts/semiclip to 0.2.2, and puts the 0.3.5 module on the server in AMXTS_SERVER.

👉 Changelog

compare changes

🚀 Enhancements

  • compiler: for...of over an array's entries() (5abe3ce)
  • semiclip: Grenades and standing on a partner's head (4326d99)
  • compiler: Entries(), keys(), values() on typed arrays (532a838)
  • semiclip: A partner fades to opacity, then out in a tenth (811e41e)
  • kit: setWalkThroughOptions for a module (a4fcb99)
  • kit: ⚠️ Walking through each other for modules only (1a99bd6)
  • hooks: sendUserInfo event and player.info.resend (3d8d405)
  • testing: Advance() fires frame events (76bc6ed)

🩹 Fixes

  • semiclip: A grenade's groups off with empty slots on Valve's HLDS (0ae7a70)
  • semiclip: A partner one stands on is drawn whole (726107e)
  • players: A bot that joins a side on Valve's game is in it (1fc50fe)
  • messages: A UserMessage of a game's fixed-size message (111f5c2)
  • hooks: sendUserInfo on plain HLDS from the first map (06cd532)
  • runtime: A plugin goes on after many errors (f89b9db)
  • runtime: Slow-frame lines name the timer or coroutine (0ddbb09)
  • runtime: Slow walk line names the dispatch gap (367ea41)
  • runtime: Refuse message_begin with an invalid id (8d999e5)
  • runtime: Temp-entity overflow names the plugin that wrote the most (6b6a5ce)
  • runtime: Async slow line times the coroutine, not the reaction (be12c9d)
  • runtime: Time async reactions with the hi-res clock (4d6466a)
  • runtime: Round the async timings through Whole() (f36fead)
  • runtime: Slow lines name timers and reactions on a server (0f2875a)

📖 Documentation

  • semiclip: The look's examples hide a partner at 48 (387afe4)
  • semiclip: The look's examples hide a partner at 60 (4de681f)
  • players: sendUserInfo arrives in 0.3.5 (2922714)
  • A message_begin with an unregistered id is refused (0200614)

⚠️ Breaking Changes

  • kit: ⚠️ Walking through each other for modules only (1a99bd6)

❤️ Contributors

📦 Files

  • amxts-server-windows-x64.zip, amxts-server-linux-x64.tar.gz - the server kit: the module and an example plugin, hello.aot.
  • amxts_amxx.dll, amxts_amxx_i386.so - the module alone.
  • wamrc-* - WAMR's AOT compiler, per system, which @amxts/wamrc-<system> carries for npx amxts build.
  • amxts-windows.json, amxts-linux.json - what each was built from, with every file's sha256.
perms

v0.2.0

For the 0.3 cores.

🔑 A password on any entry

A SteamID can be faked on a server that lets players in without Steam, so I let any entry carry a password - a SteamID's and an IP's too, not only a name's. The player gives it with setinfo _pw; with a wrong one he plays as default. It is set and taken away from the server console, and the file keeps only its SHA-256:

perms user STEAM_0:1:12345 password secret
perms user STEAM_0:1:12345 password          # no password any more

perms import keeps users.ini's passwords for SteamID and IP entries too.

The editor's page sees which entries have a password (password: true); the password itself never leaves the server.

⚠️ Breaking changes

  • perms import keeps the password of a SteamID or IP entry of users.ini that has no e flag, as AMX Mod X does: such a player gives it with setinfo _pw, or plays as default. Before, the import dropped it and let him in by his SteamID alone.

👉 Changelog

compare changes

🚀 Enhancements

  • A password on any entry, a SteamID's too (9706c90)
  • editor: The page sees whether an entry has a password (70be0bb)

❤️ Contributors

resemiclip

v0.2.1

For the 0.3.4 core and the later cores of the 0.3 line.

Installed, semiclip now reaches the server with no plugin of yours: it says standalone: true, and a 0.3.4 core builds it whenever amxts.config.ts lists it. Teammates walk through each other, and a partner is see-through up close, from npx amxts module add semiclip on. Before, the build left it out until some plugin used semiclip.

👉 Changelog

compare changes

🚀 Enhancements

  • Semiclip is built with no plugin using it (1651d09)

❤️ Contributors

amxts

v0.3.4

v0.3.4 is a patch release of the 0.3 line. Plugins built with 0.3.0 to 0.3.3 load on its module as they are.

🧩 A module that works on its own

A module no plugin uses is left out of the build, so that one installed and forgotten does not load on the server. That left out a module whose whole job needs no plugin: semiclip, whose rule covers every player. 👉 A module now says so in its definition, and is built whenever amxts.config.ts lists it:

export default defineModule({
    meta: { name: "semiclip" },
    standalone: true,   // built whenever the config lists it
});

semiclip 0.2.1 says it: npx amxts module add semiclip, and teammates walk through each other with no plugin of your own.

✅ Upgrading

npm install -D @amxts/cli@latest   # pnpm add -D, yarn add -D, bun add -d
npx amxts upgrade

It moves @amxts/core to 0.3.4 and @amxts/semiclip to 0.2.1, and puts the 0.3.4 module on the server in AMXTS_SERVER.

👉 Changelog

compare changes

🚀 Enhancements

  • modules: A standalone module is built unused (91c5911)

❤️ Contributors

📦 Files

  • amxts-server-windows-x64.zip, amxts-server-linux-x64.tar.gz - the server kit: the module and an example plugin, hello.aot.
  • amxts_amxx.dll, amxts_amxx_i386.so - the module alone.
  • wamrc-* - WAMR's AOT compiler, per system, which @amxts/wamrc-<system> carries for npx amxts build.
  • amxts-windows.json, amxts-linux.json - what each was built from, with every file's sha256.
amxts-cli

v0.3.3

For the 0.3.3 core. It drives no older core, and a 0.3.2 command drives no 0.3.3 core: update both, the command first, then npx amxts upgrade.

Every task of the core - build, dev, prepare, check, upgrade - runs on its own Node, and a project no longer installs Bun. The command takes a Bun from PATH only for bun test, in a project without Vitest, and says how to get one there. amxts info shows that Bun (475222b).

🔎 A plugin checked against a server's module

Before an upload, --against checks the built plugins against the module the server runs, read from its file. It names every plugin the module would refuse, with the imports the module lacks, and with --deploy nothing is deployed then:

npx amxts build --os linux --against amxts_amxx_i386.so

The module is the server's addons/amxmodx/modules/amxts_amxx_i386.so (or amxts_amxx.dll) (90afd41).

amxts module add perms finds @amxts/perms - groups and permissions with an editor in the browser - in the catalog the command carries (31eace9).

The official resemiclip module is semiclip now, @amxts/semiclip: npx amxts upgrade puts it in place of @amxts/resemiclip in package.json and amxts.config.ts, and amxts module add resemiclip adds it under its new name (043ba70).

👉 Changelog

compare changes

🚀 Enhancements

  • The core's tasks on Node, Bun only for bun test (475222b)
  • modules: Perms in the bundled catalog (31eace9)
  • build: --against checks plugins against a module (90afd41)
  • upgrade: @amxts/resemiclip becomes @amxts/semiclip (043ba70)

❤️ Contributors

resemiclip

v0.2.0

For the 0.3.3 core and the later cores of the 0.3 line.

@amxts/resemiclip is @amxts/semiclip now, and it needs nothing but amxts. I moved semiclip off the ReSemiclip Metamod plugin: the rule you set drives the core's own pairs, player.walksThrough, which the core has since 0.3.3, so a server needs no plugin beside amxts. And it works as soon as it is installed: teammates walk through each other, see-through up close and not drawn right against you, before any plugin sets a rule. A rule reads as before:

semiclip.rule = (player, target) => player.team == target.team;

One thing was wrong in the old README: a pair walks through when the rule lets either one, not both - which is what ReSemiclip did too, so your rule behaves as it did. How a partner looks up close is the core's server.walkThroughLook:

server.walkThroughLook = { fadeDistance: 250, opacity: 0.4, hideDistance: 48 };

⚠️ Breaking changes

  • The package is @amxts/semiclip: npx amxts upgrade puts it in place of @amxts/resemiclip in package.json and amxts.config.ts, and rewrites a plugin's import ... from "@amxts/resemiclip". The global semiclip keeps its name, so most plugins do not change.
  • semiclip.passesThrough(player) is gone: write [...player.walksThrough].
  • It needs @amxts/core 0.3.3.
  • With no rule of a plugin's, teammates walk through each other and the look is on (server.walkThroughLook = { fadeDistance: 250, opacity: 0.4, hideDistance: 48 }). When the rule's plugin stops, teammates walk through each other again; semiclip.rule = null makes everyone solid. Nothing hands the rules back to ReSemiclip any more.

👉 Changelog

compare changes

🚀 Enhancements

  • ⚠️ Semiclip on the core's own pairs (8a828bd)
  • ⚠️ The module is semiclip, @amxts/semiclip (f64ac55)
  • Teammates walk through each other by default (3fd6edc)

⚠️ Breaking Changes

  • ⚠️ Semiclip on the core's own pairs (8a828bd)
  • ⚠️ The module is semiclip, @amxts/semiclip (f64ac55)

❤️ Contributors

amxts

v0.3.3

v0.3.3 is a patch release of the 0.3 line. Plugins built with 0.3.0, 0.3.1 and 0.3.2 load on its module as they are; the new events need the 0.3.3 module, which npx amxts upgrade puts on your server.

📣 Some news

👁️ What each player is sent

Since 0.3, entityState changes what one player sees of an entity. 👉 0.3.3 opens the rest of what the server sends a player each frame: what his own client is told about him (clientData), where the server looks from to pick what he is sent (visibility), and the move command his client sent (cmdStart). Each is written for one player alone, and a server with no listener pays nothing for it.

game.addEventListener("clientData", (event) => {
    if (event.player.flags.includes("onGround")) return;
    event.maxSpeed = 200;                    // his client predicts him slower in the air
});

const replays = new Map<number, number[]>();  // where the replay each player watches is, by id

game.addEventListener("visibility", (event) => {
    const point = replays.get(event.player.id);
    if (point != null) event.addOrigin(point);   // he is sent the walls and doors around it too
});

A plugin that shows a player a place his own eyes are far from - a replay, a rewind, a camera - can now send him that place, and freeze or slow what he sees there without touching anyone else.

🧯 An error is never silent

A throw in a listener that your own code reached - a command run with server_exec, a forward emitted, a player kicked - from inside a try or an async function ended that listener without a word, and landed in your code instead: a catch got it, an await rejected with it, and the rest of the function never ran. 👉 In 0.3.3 a listener is a call of its own wherever it starts from, as a listener of dispatchEvent is in JavaScript: its error ends that listener alone, the console names it, and your code goes on.

And every error a plugin hits now goes to AMX Mod X's log too (addons/amxmodx/logs), not only to the server console: a host's panel often keeps no console, and the log is what you send us when something breaks.

🚶 Players walk through each other, with nothing else on the server

Semiclip needed a module of its own beside AMX Mod X, ReSemiclip, and the official resemiclip module only passed it bit masks. 👉 In 0.3.3 the core does it itself: two players you pair walk through each other, their clients predict it without a jolt, and one who comes close can turn see-through or vanish from your view. It all runs in the module, with no call into your plugin per pair, and a server with no pair pays nothing.

game.addEventListener("spawn", ({ player }) => {
    for (const mate of server.players) if (mate.team == player.team) player.walksThrough.add(mate);
}, true);

server.walkThroughLook = {
    fadeDistance: 250,   // closer than this a partner is see-through...
    opacity: 0.4,        // ...this opaque right next to you
    hideDistance: 48,    // and closer than this, not drawn at all
};

One you cannot see is no target either: the name under your crosshair, your shots and +use go through him. And on ReGameDLL a partner does not shield you from a flash. The official semiclip module, @amxts/semiclip (the former resemiclip), moves onto it in its 0.2.0 and needs nothing but amxts; npx amxts upgrade puts it in place of @amxts/resemiclip.

👀 Highlights

🔪 A weapon's look in his hands

One view model can hold several looks of a weapon as body groups - a knife with several finishes. weapon.viewBody picks the one his hands show, and a spectator watching him through his eyes sees the same:

game.addEventListener("defaultDeploy", (event) => {
    if (event.weapon.classname != "weapon_knife") return;
    event.viewModel = "models/myplugin/v_knife.mdl";
    event.weapon.viewBody = 2;               // the third finish of the model
});

🎞️ An entity's animation, for one player

entityState has the model's animation: sequence, gaitSequence, frame, frameRate, animTime and ducking. A frameRate of 0 holds a model in one pose for one player while the others see it move.

🕹️ The move command

A cmdStart listener reads and writes the command the game moves a player by: forward, side, up, msec, buttons, angles and impulse, with the names bot.move takes.

server.addEventListener("cmdStart", (event) => {
    // A side speed the strafe keys did not give is taken away.
    if (event.side != 0 && !event.buttons.includes("moveLeft") && !event.buttons.includes("moveRight")) event.side = 0;
});

The fake server runs it too: server.runCommand(player, command), and server.sendVisibility(player) for the visibility listeners.

✉️ A message of your own

A plugin can now send its own message - to a client-side mod of yours, say - by name, as the game sends its own:

const jump = new UserMessage("MyJump");          // registered when the plugin starts

jump.byte(1).coord(distance).text(player.name).send(player);   // one player
jump.byte(2).sendAll();                                         // everyone

get_user_msgid, message_begin and register_message know it, in Pawn plugins too, and it keeps its id on every map.

🎨 Sprays, sparks and other temporary effects

The game's temporary effects - a spray on a wall, sparks, a beam - are the tempEntity message: type is the effect's TE_* number and source what made it, the spray can (whose owner is the player) or the player whose move made it. And any message can now go to some players only, with recipients:

server.addMessageListener("tempEntity", (event) => {
    const maker = event.source?.owner ?? 0;   // a spray can's player
    if (hidden.has(maker)) event.recipients = server.players.filter(player => !hidesOthers.has(player.id));
});

⚡ Faster builds, and Node is all you need

A plugin that awaits is no longer compiled twice, the compiles run side by side as far as the machine's memory allows, and every task of the amxts command - build, dev, prepare, check, upgrade - runs on Node, in far less memory. A save in amxts dev rebuilds a large plugin several times faster than in 0.3.2. A project no longer installs Bun: Node 24 is all it needs. amxts build writes the same files byte for byte.

🔁 An upload restarts only its plugin

Uploading a plugin's .aot to a running server restarts that plugin and the plugins that use its module - not every plugin - and the files are read and prepared while the game runs, so the players do not feel it. A plugin can carry what it holds across that restart:

let run = server.kept<Uint8Array>("run") ?? new Uint8Array(0);   // what the previous run kept
server.addEventListener("end", () => server.keep("run", run));

📋 plugins.ini on a live server

A line added to plugins.ini loads its plugin, and a line taken out unloads it, with no restart and no command - a server without rcon included. A shared module's plugin loads before the plugins that use it wherever its line is, so a module listed last no longer loses every call its users make as they start (b32d173). And a dictionary uploaded after its plugin is read again as soon as it lands, not at the next map (8ea5dde).

🩺 A server that tells you what holds it

  • A listener, timer or command that holds the frame longer than amxts_slow_ms (5 ms unless you set it) is named in the console and in AMX Mod X's log, with its plugin and its time - and so is a plugin's async work after an await, and an upload's restart of plugins, split into its parts. When several listeners of one event held the frame together, the line says so and names the slowest of them in that very call, with its own time: by the function's name (trackRuns (3 of 10), 3.1 ms), or for an arrow by where it starts (a function at plugins/replay.ts:987 (5 of 10)). The line comes at once, then while it goes on after 10 s, 20 s, 40 s and so on up to 10 minutes, so a plugin a little over the limit does not fill the log. It prints the server's own amxts_slow_ms.
  • server.precached counts the models, sounds and files the map has precached, and the log warns as they near the engine's 512 - naming the last file and the plugin.
  • When a plugin's temporary effects fill a player's packet, the log says so, instead of the player silently seeing none of them.

🗄️ A query's rows, several times faster

JSON.parse reads its text straight into the type you asked for, with no tree in between, and so a database query's rows - which reach a plugin as JSON - and fetch's answers come several times faster, with far less for the garbage collector. A plugin that reads thousands of rows no longer holds the frame for them. A text that does not fit the type is read the old way, so its error says the same as before.

🛠️ And more

  • concat takes any number of arguments, as in TypeScript: a.concat(1, [2, 3], b), s.concat("x", "y");
  • entity.lip, how far short of its full travel a door, a platform or a button stops;
  • a class with values() and no length is walked by for...of and [...] as a Set is - player.walksThrough among them;
  • the Storage page says how to add a field to a stored type without breaking the records already saved: declare it optional and read it with a default;
  • a call to a shared module no plugin runs is said in AMX Mod X's log too, once for each module in each load of the plugin (24d0311);
  • amxts build --against amxts_amxx_i386.so says whether a server's module loads the built plugins, and what it lacks, before an upload; a build names the imports a plugin uses that the last release has not, and the module says "needs a newer amxts than 0.3.2" for one built with an unreleased core.

🩹 Important fixes

  • A ReHLDS server stopped by its panel, docker stop or systemd crashed on the way out and left a core file, and Storage's last second was lost: the module's threads now stop cleanly at exit, the stores are written, and ReHLDS's own stop signal handler - installed broken by hlds_linux - is set again correctly (d5d0cfc, 9ad9590).
  • An error between message_begin and message_end left the message open, and the next message - the game's own - could break the server. The message is now ended or dropped and the plugin named (b082b16).
  • A chat line longer than the engine's message - a translation in Georgian, a long name - stopped the server; it is now cut to fit (ed37111).
  • A stored record kept before a field was added lost the class's defaults when the class's constructor takes arguments - a text field came back null. Now the default stays, and a record that still cannot be read names the storage, the key and the field (d7e359e).
  • On Node, amxts dev did not see a change to amxts.config.ts, amxts prepare on Windows wrote no tooltips in another language, and a plugin's test of an HTTPS server with its own certificate failed (0035d85, 8dc1435, 207f581).
  • A loop that keeps the index of its best element - the nearest, the smallest, the largest - returned 0 whatever it found, when the comparison was of fractional numbers and the best value was kept in a variable of the loop. A silent wrong answer since 0.3.0 (259cbbb).
  • A listener's error entered from a try or an async function was swallowed and cut its caller short (3b233b4).
  • A plugin's error was printed to the server console only (e386030).
  • A plugin whose memory could not grow - on a 32-bit server past about 1 GiB - kept being called with its allocator broken, and flooded the console and the log until the map changed. Now it stops at the next frame with one line that says why and how big its memory is, amxts_plugins lists it as stopped and shows each running plugin's memory, and amxts_reload starts it again (d68278e).
  • A SteamID typed into a console command - amx_ban STEAM_0:1:123 - reached the command in five words, since the engine splits at :; a command's words now keep it whole, ,, ' and brackets too (97ac57a).
  • A write_* after a message_begin that failed - an id the game does not know, a player who is not there - reached the engine with no message open, and the server stopped. Now the writes and the end are dropped, the begin's error is logged, and the server goes on (8d4b091).
  • On Windows with an mp.dll amxts does not know, game.restartRound() and the win check could call the wrong function and crash the server; they now answer 0 and say so once in the console (d42365d).
  • player.kill() killed nothing on Valve's game when the player was a bot a plugin had added: the game's kill command turned him down. It now kills any living player on every server, and is recorded as the same suicide (59e7249).
  • entity.killed(world, 0) - a death no damage led to - crashed a server running Valve's game (261f1dd).
  • A plugin's test that set a pair of players walking through each other threw "unsimulated": the fake server answers it now (1a61470).

✅ Upgrading

Update the command with your project's package manager, then upgrade:

npm install -D @amxts/cli@latest   # pnpm add -D, yarn add -D, bun add -d
npx amxts upgrade

It moves @amxts/core to 0.3.3, builds, and puts the 0.3.3 module on the server in AMXTS_SERVER. Another server takes the module from the release and the .aot files from your build. Rebuild every plugin: a plugin built with 0.3.2 runs on the new module, but only a rebuilt one gets the fixes of the compiler and of listeners' errors.

The command and the core move together this time: every task of the command runs on Node now, and amxts 0.3.3 drives only a 0.3.3 core, as the 0.3.2 command drives only its own - each says which one to update when they differ. Update the command first, as above, and upgrade brings the core to it. A project needs Node 24 and no longer installs Bun.

!NOTE A plugin that listens to clientData, visibility, reads cmdStart's fields, makes a UserMessage, or uses server.keep, server.kept, server.precached, player.walksThrough, server.walkThroughLook or entityState's solid does not load on an older module. Put the 0.3.3 module on the server with the plugin.

A project's own 0.3.2 command, run as npx amxts upgrade before the command was updated, installs the 0.3.3 core and then stops with "speaks cli-api 6": run npx amxts upgrade once more, and the 0.3.3 command it installed finishes the upgrade.

👉 Changelog

compare changes

🚀 Enhancements

  • hooks: clientData event and weapon.viewBody (02e72d7)
  • hooks: entityState animation fields (e8274b2)
  • hooks: clientData view fields (8d745f9)
  • events: cmdStart reads the move command (212b4bb)
  • events: Visibility moves where a player sees from (f68f4e3)
  • events: Visibility adds points a player sees from (15d592f)
  • messages: UserMessage, a plugin's own message (3966558)
  • server: A plugin's state across its reload (0269c89)
  • module: Name a listener that holds the frame (37dbb6b)
  • server: server.precached and a warning near the precache room (1cc0911)
  • module: Say when a plugin's effects fill a player's packet (28f31e6)
  • entities: entity.lip, how far a door stops short (4b4cd68)
  • messages: tempEntity, and recipients on any message (7c268db)
  • build: Check plugins against a server's module (33b37d9)
  • module: plugins.ini order and changes on a live server (b32d173)
  • lang: A dictionary is read again when it changes (8ea5dde)
  • module: Name the slow listener, repeat the line less often (40a0354)
  • api: Players walk through each other (55c0183)
  • api: A partner not drawn is no target (511c34c)
  • api: WalksThrough as a Set, the look as an object (091d957)
  • upgrade: Imports of @amxts/resemiclip become @amxts/semiclip (4a8d82a)

🩹 Fixes

  • compiler: Concat takes any number of arguments (8ad933a)
  • hooks: Windows calls game rules only on a known mp.dll (d42365d)
  • hooks: viewBody keeps the client's animation in step (42e5d2e)
  • hooks: A viewBody deploy's draw only in hand (d55b196)
  • hooks: viewBody for in-eye spectators (572c09f)
  • hooks: viewBody 0 holds the weapon (a97d3a4)
  • hooks: Keep viewBody when an in-eye spectator spawns (3d4ecbb)
  • events: No usercmd import in plugins that only wait (fb4a6a9)
  • compiler: Read a kept whole number from its i32 local (259cbbb)
  • events: A listener's error ends that listener alone (3b233b4)
  • module: A plugin's failure in AMX Mod X's log too (e386030)
  • module: A failed message_begin cannot stop the server (8d4b091)
  • module: A chat line fits the engine's message (ed37111)
  • package: Carry the Node hook of the compile workers (b861dd5)
  • upgrade: The same order of changes on every system (acc783e)
  • module: The slow-listener clock without the x87 (4902bf6)
  • testing: Fetch trusts a test's own CA on Node (207f581)
  • prepare: Tooltips in another language on Node on Windows (8dc1435)
  • config: A changed amxts.config.ts read again on Node (0035d85)
  • storage: A record kept before a field was added reads (d7e359e)
  • test-server: A core dump left at the stop is reported (d4af6e7)
  • module: A server stopped by SIGTERM exits without a core dump (d5d0cfc)
  • module: Storage's last write at exit asks AMX Mod X nothing (0c88562)
  • module: A ReHLDS server's stop returns from its handler (9ad9590)
  • module: SA_RESTORER for the Linux build (d051a07)
  • module: A message a call leaves open is ended for it (b082b16)
  • module: amxts_slow_ms covers async work and reloads (ff30a71)
  • messages: Recipients start empty; spray test on plain HLDS (06928d3)
  • commands: A SteamID comes whole in a command's words (97ac57a)
  • module: A plugin out of memory stops (d68278e)
  • modules: A module with no owner is logged once a load (24d0311)
  • module: Name the slow listener the author wrote (6de6665)
  • module: Name the slowest of the call the line says (7d8e869)
  • module: Name the slowest again after a reload (363cc16)
  • testing: Simulate players walking through each other (1a61470)
  • players: Kill() kills a bot on any server (59e7249)
  • module: Killed() by the world on Valve's game (261f1dd)

🔥 Performance

  • build: Stop asc early for a plugin that awaits (45cee0d)
  • build: Compile with half the free memory (7703592)
  • build: Compile under Node when it is installed (1d5a557)
  • build: Build and dev run on Node (8937b94)
  • module: An upload reloads only its plugin (7cd7abe)
  • build: A dev rebuild of a large plugin without -O3 (7adde0e)
  • cli: Every task on Node, and no Bun in a project (f08a123)
  • build: A dev save starts at the plugin's last wamrc level (b4acda0)
  • module: A module owner's upload preloads its users (0c72980)
  • json: Read JSON.parse text straight into T (bd769dc)

📖 Documentation

  • storage: A field added later is optional (5cdf18a)
  • The core's tests run with npm test, on Vitest (02af320)
  • The core is built and tested with npm run (58a1fa2)
  • time: Which clock each event sees (2bb61fb)
  • install: A module owner's users are prepared off the frame too (1d100ab)
  • A plugin out of memory, a command's words (4f59687)
  • plugins.ini order and watch, dictionaries read again (c9d7b1f)
  • players: Dead players pass only while a pair is set (1203a8b)
  • The semiclip module by its new name (e7f9848)

❤️ Contributors

📦 Files

  • amxts-server-windows-x64.zip, amxts-server-linux-x64.tar.gz - the server kit: the module and an example plugin, hello.aot.
  • amxts_amxx.dll, amxts_amxx_i386.so - the module alone.
  • wamrc-* - WAMR's AOT compiler, per system, which @amxts/wamrc-<system> carries for npx amxts build.
  • amxts-windows.json, amxts-linux.json - what each was built from, with every file's sha256.
perms

v0.1.1

For cores of the 0.3 line from 0.3.2.

A server that runs the editor's store of its own gets its own link. With PERMS_EDITOR_URL in .env, perms editor prints the store's address, and the store sends the browser on to the editor page with that store:

PERMS_EDITOR_URL=https://perms.myserver.com
[perms] Open the editor (an hour): https://perms.myserver.com/editor#k3x9q2mw7a

👉 Changelog

compare changes

🚀 Enhancements

  • editor: A store of your own gives its own link (3f384fc)

❤️ Contributors

perms

v0.1.0

The first release of Perms, for cores of the 0.3 line from 0.3.2.

Perms is a permissions module for amxts servers: it replaces AMX Mod X's admin.amxx with permission nodes, groups and a web editor, the way LuckPerms does for Minecraft servers. Pawn plugins keep working unchanged, because the module gives every player AMX Mod X's flags from his amxx.* nodes.

👀 Highlights

🔑 Nodes, groups, weights

A permission is a node, kz.admin.kick. kz.admin.* gives everything under it, and -kz.admin.wipe takes one away. Groups inherit from each other and have a weight; every player is in default; and a player's own grants come before his groups. A grant or a group can last 30d and then go by itself, and on a shared database it can count on one server only.

perms.declare({
    "myplugin.kick": { description: "Kick players" },
    "myplugin.help": { description: "Use /help", everyone: true },
});

server.addCommand<KickArgs>("/kick <target>", ({ player, target }) => {
    if (!perms.has(player, "myplugin.kick")) return player.print("You may not kick");

    target.kick("Kicked");
});

perms.addGroup(player, "vip", { for: 30 * 86400 });
perms.addEventListener("change", ({ player }) => refreshTag(player));

🌐 A web editor

perms editor in the server console prints a link. The page shows every plugin's permissions with their descriptions, a column per group, and the groups and players. Saving sends the changes back, and the server applies them within seconds, without a restart. Passwords and the database's address never leave the server.

🗄️ A file or MySQL

The permissions live in perms.yaml, which you can edit by hand. Or, with PERMS_DB in .env, they live in MySQL, shared by several servers, and a change on one reaches the others within five seconds.

🧰 In place of admin.amxx

perms import users.ini turns AMX Mod X's admins into entries, with their flags as amxx.* permissions. access, cmd_access, amx_mode, amx_password_field, amx_default_access and amx_reloadadmins keep working. Pawn plugins can check nodes themselves through perms.inc: perms_has, the groups, and the perms_changed forward.

Permissions change from the server console and in the editor. In the game, a player with perms.view can look them up.

👉 Changelog

commits

🚀 Enhancements

  • Perms, permissions and groups for amxts servers (87bd13f)
  • Permissions change from the server console and the editor only (59bdf72)
  • The editor's store at perms-store.brokukaschannel.workers.dev (69dd613)
  • editor: The page is amxts.github.io/modules/perms/editor (9fba515)

🩹 Fixes

  • SteamIDs from the console, and say which file is read (5da51ef)
  • editor: Bots are not players (cc0b0e3)

❤️ Contributors

amxts

v0.3.2

v0.3.2 is a patch release of the 0.3 line. Plugins built with 0.3.0 and 0.3.1 load on its module as they are; the new things need the 0.3.2 module, which npx amxts upgrade puts on your server.

📣 Some news

🔌 Forwards of C++ modules reach TypeScript

A forward a Pawn plugin raises has reached Forward.subscribe since 0.3. A forward an AMX Mod X module written in C++ raises (MF_ExecuteForward) reached only the Pawn plugins. 👉 In 0.3.2 it reaches TypeScript too, after the Pawn plugins' handlers, with every kind of argument: numbers, floats, strings, arrays and by-reference values.

const jumped = new Forward<Player, number>("mymodule_on_jump");

jumped.subscribe((player, height) => {
    console.log(`${player.name} jumped ${height} units`);
});

A module hands its forwards to amxts when AMX Mod X loads it after amxts, so amxts_amxx goes on the first line of modules.ini. npx amxts upgrade puts it there, and the server console names any module listed above it.

A Pawn forward made with ET_STOP or ET_STOP2 that a Pawn public stopped no longer reaches TypeScript subscribers, as AMX Mod X itself would do for one more plugin.

🎯 Valve's HLDS hears the game first

Without ReGameDLL, most of the game rules' events were heard only after the game had acted, and their questions (fallDamage, canHaveItem, canRespawn, ...) were not heard at all. 👉 In 0.3.2 they are heard the way ReGameDLL hears them: before the game acts, with answers, written fields and preventDefault() taken.

game.addEventListener("fallDamage", (event) => event.result / 2, true);   // half the fall damage

game.addEventListener("addMoney", (event) => {
    if (event.player.isBot) event.amount = 0;
});

That is 21 events - the questions, playerSpawn, playerKilled, newRound, deathNotice, gameThink and the rest - plus addMoney and giveDefaultItems. On Linux it works with any build of the game. On Windows it works with the builds of Valve's game amxts knows: the one steam installs and its steam_legacy branch. With another mp.dll the console says so once and the events are heard as before. The table on the hooks page shows what each event gives on such a server.

👀 Highlights

🔢 A byte is a number

An element of a Uint8Array (and of Int8Array, Uint16Array, Int16Array, Uint8ClampedArray) is a number, as in JavaScript. Arithmetic on it no longer wraps at 8 bits, so reading a file's words gives what JavaScript gives:

const word = bytes[i] | (bytes[i + 1] << 8);   // a little-endian word

Loops over bytes keep their integer code, and are faster than the same loop in Pawn.

➕ push and unshift take any number of values

names.push("a", "b", "c");
names.push(...others);

🛠️ And more

  • entity.touch() and the entity actions (restart(), think(), ...) cost less, and are faster than Pawn's ExecuteHamB on every machine the speed suite runs on;
  • the compiler keeps fewer values on its stack for the garbage collector, which makes the facade's calls cheaper everywhere.

🩹 Important fixes

  • ExecuteHam(Ham_DeathSound, ...) and any other Ham function Counter-Strike has not got crashed the server; such a call now answers 0 and says so once in the console (959bcf0).
  • bytes[i] << 8 was cut back to 8 bits, so decoding a word from a file's bytes gave garbage (21610b6).
  • A generic call to an arrow declared further down the file did not build ("Type argument expected") (7da3818).
  • A stopped Pawn forward reached TypeScript subscribers (e0dd372).
  • @amxts/core/zlib and the query builder had no types on the site, and its examples did not type-check (a907e84, 58883e0).

⚠️ Breaking changes

One, listed by npx amxts upgrade:

0.3.10.3.2upgrade
a use event's event.caller was the one who used the entity, event.activator what passed the use onnamed as the game passes them: event.activator uses the entity, event.caller passes the use onlists each caller and activator of a use event

entity.use() calls do the same as before; only its parameters' names changed.

✅ Upgrading

Update the command with your project's package manager, then upgrade:

npm install -D @amxts/cli@latest   # pnpm add -D, yarn add -D, bun add -d
npx amxts upgrade

It moves @amxts/core to 0.3.2, lists the use events to check, puts amxts_amxx on the first line of modules.ini, builds, and puts the 0.3.2 module on the server in AMXTS_SERVER. Another server takes the module from the release and the .aot files from your build.

👉 Changelog

compare changes

🚀 Enhancements

  • hooks: Game rules' questions on plain HLDS for Linux (55a14a1)
  • forwards: A module's forward reaches Forward.subscribe (b036bc6)
  • hooks: Plain HLDS hears game rules' events first (20b51c5)

🩹 Fixes

  • site: The hood's files from the build's own list (a907e84)
  • site: The editor's own .types.d.ts files in the site's declarations (58883e0)
  • hooks: ⚠️ A use event's activator and caller the right way round (535a989)
  • forwards: A stopped Pawn forward skips TypeScript (e0dd372)
  • compiler: A typed array's element is a number (21610b6)
  • compiler: An arrow declared below types a generic call (7da3818)
  • forwards: The sanitized module builds again (db6b3d0)
  • hooks: ExecuteHam of a function the game has not got (959bcf0)
  • hooks: Game rules' questions hooked before the map's rules exist (366bee1)
  • hooks: checkMapConditions not hooked on plain HLDS (a684626)
  • hooks: original_hook's import passes the editor's check (dffb78d)
  • compiler: Push and unshift take any number of values (b11f2fe)

🔥 Performance

  • entities: An action with hooks keeps no Call's frame (2bbffd2)
  • compiler: An argument keeps a slot only if held (3661bd4)
  • compiler: Whole numbers bounded by i + c in i32 (b712462)
  • compiler: An array's keeps no frame for its error (ff9a2f7)

⚠️ Breaking Changes

  • hooks: ⚠️ A use event's activator and caller the right way round (535a989)

❤️ Contributors

📦 Files

  • amxts-server-windows-x64.zip, amxts-server-linux-x64.tar.gz - the server kit: the module and an example plugin, hello.aot.
  • amxts_amxx.dll, amxts_amxx_i386.so - the module alone.
  • wamrc-* - WAMR's AOT compiler, per system, which @amxts/wamrc-<system> carries for npx amxts build.
  • amxts-windows.json, amxts-linux.json - what each was built from, with every file's sha256.
amxts-cli

v0.3.1

For cores of the 0.3 line.

amxts needs Node.js 24 or newer, and says so on an older one: on Node 22, npm 10 fails installing a new project's test runner on Linux.

The line about the server's module says that a newer amxts is out and that amxts upgrade puts it in - as information while the module is of the project's line, as a warning when it is of another line and will load no plugin (e5510d1).

👉 Changelog

compare changes

🩹 Fixes

  • server: A newer amxts for the server, told not warned (e5510d1)

❤️ Contributors

menu-core

v0.3.1

For cores of the 0.3 line, from 0.3.1.

👀 Highlights

📄 Pages of text

A menu made only of text lines - rules, a help screen, a top list - pages itself: 8 Next, 9 Back and the page tag, a page ending before the menu's 512 bytes. linesPerPage puts more lines on a page:

const rules = menus.create("LIST_RULES", { title: "Rules", linesPerPage: 11 });
rules.setListSource(({ player }) => lang.translate(player, "RULES").split("|").map(line => menus.textRow(line)));

The page tag [n | m] ends the title's first line, so a title of two lines keeps its second under it.

👉 Changelog

compare changes

🚀 Enhancements

  • menus: A list of text lines alone pages them (d70d3e6)
  • menus: linesPerPage, and the page tag ends a title's first line (478a052)

📖 Documentation

  • menus: linesPerPage hints for Menu and MenuOptions, en and ru (fafe7a2)

❤️ Contributors

amxts

v0.3.1

v0.3.1 is a patch release of the 0.3 line. Plugins built with 0.3.0 load on its module as they are; the new things need the 0.3.1 module, which npx amxts upgrade puts on your server.

📣 Some news

🗄️ A database, built in

A plugin that kept its records in Storage had them on one server only, and a plugin that wanted MySQL had to call a web service of its own in between. 👉 In 0.3.1, MySQL is part of amxts.

The module speaks MySQL itself - no client library to install, TLS included, MariaDB too - and every query runs on its own thread, so the server never waits for the database. Tables are described in TypeScript, the way Drizzle does it, and the rows come back typed:

import { asc, double, eq, int, table, varchar } from "@amxts/core/database";

export const records = table("records", {
    id: int().primaryKey().autoincrement(),
    steamId: varchar(32).notNull(),
    map: varchar(64).notNull(),
    time: double().notNull(),
});

const db = new Database(env("MYPLUGIN_DB"));   // mysql://user:password@host:3306/myplugin, or jdbc:mysql://... as a game panel shows it
await db.create(records);

const top = await db.select().from(records)
    .where(eq(records.map, server.map))
    .orderBy(asc(records.time))
    .limit(10);

await db.insert(records).values({ steamId: player.steamId, map: server.map, time })
    .onConflictDoUpdate({ target: [records.steamId, records.map], set: { time } });

A misspelt column is an error in the editor. Every value goes to the server as a parameter, never as text in the SQL. Transactions (db.transaction(async (tx) => ...)), raw SQL beside the builder (db.query<Row>(sql, [values])), and bytes - a recording, a file - in BLOB columns as Uint8Array. Another database plugs in as a provider of its own scheme, with Database.register.

⚡ Nothing waits on the frame

Unpacking a downloaded map held the server's frame for as long as it took, and players saw it. fs.extract now unpacks on the module's worker thread, and so do writing and reading bytes, and the new compression:

import * as zlib from "@amxts/core/zlib";

for (const entry of await fs.extract(await response.arrayBuffer())) {
    fs.writeFileSync(entry.path, entry.data);
}

await fs.writeFile(`${server.dataDir}/myplugin/${name}.rec.gz`, await zlib.gzip(recording));

@amxts/core/zlib is Node's: gzip, gunzip, deflate, inflate, the raw forms, and a ...Sync of each.

👀 Highlights

🏃 A player's own movement

Air acceleration, friction, stop speed and the rest for one player - the server moves him with them and his game predicts them, on any server:

player.movement.airAccelerate = 100;   // strafes gain speed easily, for him alone
player.movement.friction = 2;
player.movement.reset();               // the server's again

🧱 Fields of your own on entities

The way plugins add fields to a player, they add them to an Entity - shared between plugins, gone with the entity:

declare module "@amxts/core" {
    interface Entity {
        doorSpeed: number;
    }
}

door.doorSpeed = door.speed;

🔊 Who hears what

A sound or a shot can go to some players only - a player who hid the others no longer hears their steps:

game.addEventListener("startSound", (event) => {
    event.recipients = server.players.filter(listener => !hidden(event.entity, listener));
});

door.emitSound("myplugin/creak.wav", { to: player });   // one player hears it

📺 HUD lines that don't steal each other's channel

A client shows four HUD channels. A line with a higher priority keeps its channel, and a line whose time is up gives it back:

const speed = new HudLine({ priority: 1 });   // redrawn every frame, always on screen

🛠️ And more

  • entity.touch(other) and entity.restart(), done by the module;
  • player.resetMaxSpeed(), player.jumpSlowdown, server.intermission();
  • fs.existsSync(path, { game: true }) looks in every folder the game reads from;
  • on plain HLDS, the move event and touchCount/frameTime are heard too;
  • the language: string | number | boolean | null values, number | null, T | T[], and a Uint8Array in JSON as base64.

Each of the new calls is checked against its Pawn way in the speed suite, and is faster.

🩹 Important fixes

  • Storage.get lost the last character of a value of 1 KB or more - JSON came back without its closing brace (2599130).
  • A Pawn plugin's amxclient_cmd reaches TypeScript commands and the "command" event (4e9118f).
  • Infinity | 0 and every number past 2^63 convert as JavaScript does (1add817).
  • A plugin may be named like a file of the core's API - facade.ts, hooks.ts (501a354).
  • The module shows its own version in amxx modules and meta list (2889b27).
  • An arrow that returns an object literal gives the interface, so rows.map((name) => ({ name, time })) is a Row[] (df82419).
  • In tests, setTimeout(fn, 0) from a listener no longer loops server.advance (f6db4d4).
  • A build stops, saying so, when the generated natives table is older than the core's code, instead of making a plugin every server refuses (7f4c5af).

⚠️ Breaking changes

Two, each listed or rewritten by npx amxts upgrade:

0.3.00.3.1upgrade
fs.extract(bytes) gives the entriesa Promise: await fs.extract(bytes); the synchronous form is fs.extractSync(bytes)rewrites a call without await to fs.extractSync; lists a named import or a reference handed on
startSound's event.recipients a number (0, 1)the players who hear it: event.recipients = server.players.filter(...)lists each use

A binary column read into a string field comes as base64 now, not as the bytes decoded as text; read it into a Uint8Array, or CAST(col AS CHAR) in the SQL.

✅ Upgrading

amxts needs Node.js 24 or newer now: Node 22's npm 10 fails installing a new project's test runner on Linux. The command says so when it runs on an older Node.

Update the command with your project's package manager, then upgrade:

npm install -D @amxts/cli@latest   # pnpm add -D, yarn add -D, bun add -d
npx amxts upgrade

It moves @amxts/core and @amxts/menu-core to 0.3.1, rewrites fs.extract, lists what to check by hand, builds, and puts the 0.3.1 module on the server in AMXTS_SERVER. Another server takes the module from the release and the .aot files from your build.

👉 Changelog

compare changes

🚀 Enhancements

  • compiler: A union of text, numbers and booleans (9002ad0)
  • database: MySQL from a plugin (952e2e9)
  • compiler: Number | null and one or a list (21e7feb)
  • compiler: A generic's arguments from a subclass (dda7bf9)
  • database: A query builder on Database (0c167ab)
  • database: An address as a game panel gives it, jdbc: (86870b9)
  • zlib: Node's zlib, off the frame on the module's worker (f8aedcd)
  • fs: ⚠️ Extract and bytes off the frame (8969c38)
  • json: A Uint8Array as base64 text (177f545)
  • database: Bytes as Uint8Array (dcb0310)
  • fs: existsSync in the game's other folders (874c4e7)
  • entities: Touch, and actions run by the module (5cc7dfb)
  • players: Own movement variables, server.intermission (13ffbe4)
  • hooks: The move event on plain HLDS (eda7288)
  • sound: ⚠️ Choose who hears a sound (8adfbfa)
  • hud: HudLine priority, and channels taken by ending (ed6f0ed)
  • entities: Fields plugins add to Entity (db61bed)

🩹 Fixes

  • storage: A value of 1 KB or more read whole (2599130)
  • module: Its version in amxx modules and meta list (2889b27)
  • commands: A Pawn plugin's amxclient_cmd reaches addCommand (4e9118f)
  • compiler: ToInt32 of numbers past 2^63 and Infinity (1add817)
  • build: A plugin may be named like a file of the core (501a354)
  • compiler: An arrow's returned literal is its interface (df82419)
  • testing: A timer armed while timers fire waits a frame (f6db4d4)
  • database: The builder's hood type-checks in the editor (20eb9be)
  • build: A natives table older than the code stops the build (7f4c5af)
  • build: A version bump makes cached compiles again (aa89604)
  • sound: emitSound's volume and attenuation as f32 bits (d538c1e)

🔥 Performance

  • player: resetMaxSpeed without a gamedata search (8145d3f)
  • entities: Touch listeners matched by class number (d1e9cb7)
  • entities: A touch without a handler call's frame (9d28099)

📖 Documentation

  • database: The query builder first, raw SQL after (fd721ba)
  • testing: server.storage keys are the Map's iterator (f7b8c38)
  • pawn: The From Pawn pages as the coverage script writes them (0d76dc4)

⚠️ Breaking Changes

  • fs: ⚠️ Extract and bytes off the frame (8969c38)
  • sound: ⚠️ Choose who hears a sound (8adfbfa)

❤️ Contributors

📦 Files

  • amxts-server-windows-x64.zip, amxts-server-linux-x64.tar.gz - the server kit: the module and an example plugin, hello.aot.
  • amxts_amxx.dll, amxts_amxx_i386.so - the module alone.
  • wamrc-* - WAMR's AOT compiler, per system, which @amxts/wamrc-<system> carries for npx amxts build.
  • amxts-windows.json, amxts-linux.json - what each was built from, with every file's sha256.
resemiclip

v0.1.3

ReSemiclip for amxts 0.2 and 0.3.

This release only widens the core it works with to @amxts/core ^0.2.2 || ^0.3.0, so it can be upgraded together with your project. Nothing else changes. Its prebuilt plugin is built for 0.3; a 0.2 project compiles it once.

👉 Changelog

compare changes

❤️ Contributors

menu-core

v0.3.0

Menu Core for amxts 0.3. It needs @amxts/core 0.3 and @amxts/config-core 0.2, and npx amxts upgrade moves a project to them.

👀 Highlights

🧩 Several at once

A plugin that answers a menu file's actions and placeholders can now give them all in one call, and read several menus ahead of time:

menus.register("CP_MENU", "CP_MORE");
menus.addActions({
    CP_SAVE: save,
    CP_WHERE: ({ player, menu }) => player.print(`You are in ${menu.name}`),
});
menus.addPlaceholders({
    saved: player => `${savedBy(player)}`,
});

An action or a placeholder is a function of the player, or of the menu's context when it needs more. These calls cross between plugins, which is why this release needs the 0.3 core.

🛡️ ADMIN and ACCESS_ADMIN built in

A menu.ini written for the Pawn menu_core often uses the ADMIN condition or the ACCESS_ADMIN restriction. Pawn's menu_core answered them itself, so here they warned "not registered" and greyed the item out even for an admin. Menu Core now answers both: ban, rcon, admin or menu access (d, l, u, y). A plugin that registers either name still has the last word.

🩹 Important fixes

  • A menu file from the Pawn menu_core keeps its words in an [Основное] section. It was read as no menu, silently. It now reads as [MAIN], and a section that isn't a menu is reported in the console (be951c2).
  • Opening the menu a player is already looking at, from a command such as chooseteam, starts it again from its first page. Before, it redrew the page they were on and seemed to do nothing. From one of the menu's own items it still stays where it was (c6afcaf).
  • The plugin reports its version, 0.3.0 (9d471a8).

👉 Changelog

compare changes

🚀 Enhancements

  • menus: Several menus, actions and placeholders at once (8a9794c)
  • menus: ADMIN and ACCESS_ADMIN built in (5ef9c8a)

🩹 Fixes

  • menus: The Pawn menu_core's Основное is MAIN (be951c2)
  • menus: Show the menu a player is on from its start (c6afcaf)
  • The plugin says its version, 0.3.0 (9d471a8)

💅 Refactors

  • player.print, not the free print (2622715)

📖 Documentation

  • A list menu's example that runs on every core (ba519eb)

❤️ Contributors

amxts-cli

v0.3.0

The command for amxts 0.3.

👀 Highlights

🖥️ A panel under amxts dev

amxts dev builds, deploys to your server and does it again on every save. Now a panel stays under its lines while it runs: the server's map, players and FPS, each plugin's state and the last rebuild. Keys rebuild, change the map or restart the round without leaving the terminal. One dev runs per project.

Prefer plain lines? npx amxts dev --no-tui.

📡 amxts rcon

Run a command on the project's server and see the answer, without opening a game client:

npx amxts rcon amxts_plugins

--json gives the answer to a script or an agent.

🔔 Know when there's a newer amxts

The command prints one line when a newer amxts is out, so you don't have to check yourself.

⬆️ Upgrading from 0.2

amxts upgrade in a 0.2 project installs this command and hands the rest over to it: the 0.3 core, the modules' versions for it, your code rewritten where 0.3 changed the API, a build, and the module on your server. It also takes 0.2's host plugin out of AMX Mod X. A build that fails now fails the upgrade, so you see it at once.

The project a new npx create-amxts writes greets players with player.print and the whole server with server.print.

🩹 Important fixes

  • A newer command installs into an older project (1da9def).
  • The starter project prints to players on every core it supports (44fbf3b).

👉 Changelog

compare changes

🚀 Enhancements

  • cli: The amxts logo in the banner (e80a915)
  • rcon: amxts rcon sends a command to the server (9a93721)
  • dev: A panel under the build, one dev per project (5920088)
  • cli: A line when a newer amxts is out (f7e4d25)
  • templates: player.print, the wave is server.print (52467a0)

🩹 Fixes

  • create: The starter prints to players, on every core (44fbf3b)
  • upgrade: Take an older release's plugin out of AMX Mod X (ba3f7fe)
  • upgrade: A failed build fails the upgrade (32882fc)
  • cli: A newer command installs into an older project (1da9def)

📖 Documentation

  • readme: The hint for an older core (b3fccfe)
  • The dev panel, amxts rcon and the update line (cfbefbc)
  • readme: The server loads only what the project builds (4bbb618)

❤️ Contributors

config-core

v0.2.0

Config Core for amxts 0.3. It needs @amxts/core 0.3, and npx amxts upgrade moves a project to it.

Nothing changes for you in how configs are read. The plugin prints through the 0.3 core's player.print (cc0fc72), which 0.2 doesn't have, so this is a minor release with the new core as its minimum. It also reports its version, 0.2.0 (f85ddc8).

👉 Changelog

compare changes

🩹 Fixes

  • The plugin says its version, 0.2.0 (f85ddc8)

💅 Refactors

  • player.print, not the free print (cc0fc72)

❤️ Contributors

amxts

v0.3.0

v0.3.0 is the next minor release.

📣 Some news

🧱 amxts is one module now

In 0.2, amxts was two pieces: the amxts_amxx module, and a host plugin, amxts_host.amxx, that sat in AMX Mod X's plugins.ini and passed the game's events on to TypeScript. Every event took a detour through Pawn on its way to your plugin.

👉 In 0.3, the host plugin is gone.

The module is a Metamod plugin as well, and it hears the game itself: the players' commands, the messages, the cvars, the log, the menus, and ReGameDLL's and ReHLDS's hookchains through its own hooks. Nothing goes in plugins.ini any more, and there is no Pawn between the game and your code.

It made amxts faster, too. I check every release against Pawn twins of the same plugins, measure by measure, and a TypeScript plugin now runs at least as fast as Pawn on every measure the suite runs, and faster on most.

🚫 No ReAPI needed

What ReAPI's rg_* natives did for the API, the module now does itself, through ReGameDLL's own API, and through the game's functions on Valve's HLDS. Giving and taking weapons, switching teams, respawning, models, the HUD, text menus, game.restartRound() and game.checkWinConditions() all work the same on:

  • ReHLDS + ReGameDLL, with or without ReAPI;
  • Valve's own HLDS with metamod-p.

ReAPI's natives are still there in @amxts/core/natives, for when your server has it and you want one.

🖥️ The server only loads, your machine builds

A server never compiles anything now: it loads the .aot files a project builds. You build with npx amxts build and upload, or let amxts dev / build --deploy do it, the same way a .sma is compiled at home and an .amxx uploaded. The server kit is a fraction of its old size as a result, and a plugins.ini line that says name.ts simply loads name.aot.

🔗 One line, one ABI

A plugin built with 0.3.0 loads on every 0.3 module: 0.3.1, 0.3.2 and so on. The official modules ship prebuilt plugins that serve the whole line, so a patch release of the core never makes you (or a module's author) rebuild.

👀 Highlights

🔐 Secrets with env()

A token or an API key shouldn't be in your code, and it shouldn't be in the .aot either: anything compiled into a plugin can be read back out of it. env() reads it on the server instead:

const token = env("MYPLUGIN_TOKEN");          // required: text
const maxRecords = env("MYPLUGIN_MAX", 100);  // a number
const debug = env("MYPLUGIN_DEBUG", false);   // on/off: 1/0, true/false, yes/no, on/off

The values live in the server's addons/amxts/.env, and the server process's environment wins over the file, so a game panel or Docker can pass them without any file on the server at all. The default gives the type. A call without one is required: the plugin doesn't start until the value is there, and the console says which one it needs, in one line. amxts dev warns you before it deploys.

💬 player.print and server.print

Printing to one player or to everyone reads the way it says:

player.print(`Welcome back, ${player.name}!`);
player.print("Round restarted", "center");
server.print("Map changes in 30 seconds");

Chat goes through the engine directly, so a chat message is as cheap as in Pawn.

⌨️ Commands, the way you'd write them

One command can have several names, and its handler gets the player:

function checkpoint(player: Player) {
    player.print("Checkpoint saved");
}

server.addCommand(["/cp", "cp"], checkpoint);   // in chat and in the console
server.addCommand(["/kz", "chooseteam"], (player) => openMenu(player));

And every command a player types reaches the "command" event, with its name, words and text, where preventDefault() stops it:

server.addEventListener("command", (event) => {
    if (event.command == "chooseteam" && !event.player.isAlive) event.preventDefault();
});

👁️ What each player sees

"entityState" is what the server sends one player about one entity, every frame. Change it, and only that player sees the change:

game.addEventListener("entityState", (event) => {
    if (event.player.team != "CT") {
        event.preventDefault();              // a marker only the CTs see
        return;
    }
    event.renderFx = "glowShell";            // and it glows for them
    event.renderColor = [0, 160, 255];
}, { classname: "myplugin_marker" });

🧩 Plugins that manage plugins

server.plugins lists every plugin on the server, TypeScript and Pawn alike, and lets you stop, start and reload one, load one the list doesn't name, or call a Pawn plugin's public function:

const shop = server.plugins.find(plugin => plugin.file == "shop.aot");
shop?.reload();

💾 Storage that keeps your types

new Storage<T>(name) keeps any interface, saved as JSON, and a missing key reads as undefined, the same as Map.get:

interface Profile { kills: number; title: string }

const profiles = new Storage<Profile>("myplugin_profiles");
profiles.set(player.steamId, { kills: 10, title: "Rookie" });

A new Storage takes over AMX Mod X's nVault file of the same name once, so nothing is lost when you move a Pawn plugin over.

📦 Files, downloads and archives

Files can be read and written as bytes, and fs.extract unpacks a zip archive, so a plugin can download a map and put it in place:

import * as fs from "@amxts/core/fs";

const response = await fetch(`https://maps.example.com/${name}.zip`);
for (const entry of fs.extract(await response.arrayBuffer())) {
    fs.writeFileSync(entry.path, entry.data);
}

🏃 Movement events: touches and frame time

The player's movement events (move, airMove, jumpMovement, duckMovement, ladderMove and the rest) have event.touchCount and event.frameTime. That's enough for jump stats without ReAPI's get_pmove.

🛠️ And more

  • traces: trace.line, player.aim (what a player is aiming at), canSee;
  • messages by name: player.send and server.send;
  • player: player.model, player.info, player.country, player.showMotd, and a light style for one player;
  • screen: player.screen.hint and HudLine.showAll;
  • shots: stop a shot, or play it to only some players;
  • between plugins: a Record<string, T> and a rest parameter can cross, and Array#flatMap compiles;
  • typecheck: amxts typecheck points at an event name kept in a variable, and at const rows = [] without its element type.

🖥️ The command, 0.3.0

amxts dev has a panel: the server's map, players and FPS, each plugin's state and the last rebuild, with keys to rebuild, change the map or restart the round. amxts rcon sends a command to the server, and the command tells you when a newer amxts is out.

🩹 Important fixes

  • A template string's parts stay alive until they are joined, so a collection in the middle of one no longer corrupts the heap (950eef68), and a closure kept in a global stays alive (ea55f8ea).
  • A menu message a plugin blocks leaves the menu's keys working (87d2ab2a).
  • A .aot uploaded while the server reads it is no longer loaded half-written (a16271d2).
  • A bot's command works on plain HLDS for Linux, and never reads a stale command line (bef4a16b, 56c5dc63).
  • viewModel and weaponModel are the model's file, as text (25a13ffc).
  • The fake server records every engine message (SVC_NEWMOVEVARS, SVC_LIGHTSTYLE, …), not only temporary effects (609d07b2).

⚠️ Breaking changes

Each with what to write instead; upgrade says what npx amxts upgrade does for you.

0.20.3upgrade
print(player, text), print(player.id, text)player.print(text)rewrites it, and drops print from the core's import once none is left
print(0, text)server.print(text)rewrites it
print({ id, variant }, text)player.print(text, variant)rewrites it; another field is listed
print(5, text) (a number)player.print(text)lists it
storage.get(key) gives null for a missing keyundefined, as Map.get; a Storage is data/amxts/storage/<name>.json, and a new one takes AMX Mod X's nVault file of its name oncerewrites == null and a string | null annotation of its value
player.give(name as ItemName)player.give(name): any textdrops the cast, and its import when nothing else names the type
player.removeAllItems(true)player.removeAllItems({ suit: true })rewrites it
viewModel / weaponModel a numberthe model's file, text ("models/v_knife.mdl")0 becomes ""; another number is listed
a test's server.vault(name)server.storage(name)rewrites it
cmd(name, handler, flag, info), cmdWide(...)no infodrops it
the server events "pause", "unpause", "modules"gone: AMX Mod X raises them for a Pawn plugin about itself alonelists the listener
reapi's DisableHookChain(handle) of a hook() handleunhook(handle)lists it
a raw native's const string as cells("h")the string as it is: "h"lists it
a raw native that registers for its calling plugin - set_task, register_clcmd, register_event, register_message, RegisterHam, RegisterHookChain, menu_create, log_amx...answers 0 from TypeScript: use the API's timers, commands, events and Menu-
.ts files on the server, built therenpx amxts build and upload the .aot, or build --deploy / amxts dev; a plugins.ini line name.ts loads name.aotbuilds the project; the server step puts the module in
amxts_host.amxx in AMX Mod Xnothing: amxts is the module alonethe server step takes the line, the plugin and its list out
addons/amxts/tools/ and build/ of an older kitnot used- delete them
the changeYaw event's answera number of degrees, a float, as the game's function returns-
a command's description in amx_help / amxx cmdslisted by server.commands alone-

✅ Upgrading

First update the command with your project's own package manager. A 0.2 project's amxts is the one its core came with:

npm install -D @amxts/cli@latest   # pnpm add -D, yarn add -D, bun add -d

Then run:

npx amxts upgrade

It moves @amxts/core to 0.3.0 and each official module to its version for it (menu-core 0.3.0, config-core 0.2.0, resemiclip 0.1.3, ftp 0.1.1), rewrites your code (the table above), builds, and puts the 0.3.0 module on the server in AMXTS_SERVER. Stop a running Windows server first, or run npx amxts upgrade --server-only after.

Then read its "to check by hand" list and run npx amxts test. For any other server, upload the .aot files, and delete an old kit's addons/amxts/tools/ and addons/amxts/build/.

!NOTE Known issues: Infinity | 0 and Infinity >>> 0 give -1 and 4294967295 instead of 0. A plugin named like a file of the core's API (facade.ts, constants.ts, hooks.ts, …) takes that file's place in the build, so name it otherwise. A Pawn plugin's amxclient_cmd reaches no TypeScript command.

👉 Changelog

compare changes

🚀 Enhancements

  • abi: A plugin loads on any patch of its line (897763dc)
  • modules: A prebuilt module serves its whole line (6c317ecf)
  • runtime: The module stays loaded as a Metamod plugin (d60d29dc)
  • commands: ⚠️ Commands in the module, bot.command (c1e439af)
  • forwards: A Pawn plugin's forward reaches subscribe (be62510d)
  • events: ⚠️ Game events through the module's own hooks (487725b6)
  • events: ⚠️ Messages, log and cvars through the module (277d3e96)
  • menus: Menus dispatched by the module (d6e302b4)
  • runtime: ⚠️ The module alone, without the host plugin (289aaa59)
  • players: A player's actions without ReAPI (e4be9385)
  • game: game.restartRound() and checkWinConditions() (7c34005f)
  • api: ⚠️ The 0.3 API - plugins, storage, traces, messages (c4aa1d13)
  • api: player.model, HUD from the module, entityState (9fa8eee9)
  • abi: A plugin checked by the imports it uses (fb66f493)
  • compiler: Array#flatMap (9aa7d20d)
  • testing: mp_freezetime and mp_round_infinite by default (dd4143c6)
  • events: A console command's name, words and text (d11b8021)
  • commands: Several names, a handler of the player (829ec644)
  • modules: A Record and a rest parameter cross between plugins (06b86ef7)
  • server: ⚠️ A server loads only .aot (b94dbe87)
  • fs: Files as bytes, and unzip (f6f2d48f)
  • screen: A light style for one player (7a04a13b)
  • cli: Typecheck reports an event name in a variable (8efeee8d)
  • events: Stop a shot, or play it to some players (7e9d3cdf)
  • fs: Extract an archive, its kind read off its first bytes (eae2e08a)
  • api: ⚠️ player.print, no free print (d7fcf7a7)
  • events: preventDefault() stops a player's command (9ecf3eca)
  • runtime: env() and the server's .env (db01c7d7)
  • events: touchCount and frameTime of the movement (0b4d3865)

🩹 Fixes

  • natives: Array sizes the includes name by a define (1930200a)
  • testing: Strings cross a native as the module passes them (4d716e0e)
  • testing: The fake server records every engine message (609d07b2)
  • runtime: A bot's command on plain HLDS for Linux (bef4a16b)
  • runtime: Align the log hook's stack on Linux (bc24500c)
  • runtime: Keep the line a bot's command puts back (ac4e62b8)
  • runtime: Bind a hook made at a plugin's top level (65ed6ab3)
  • runtime: A bot's command reads no stale command line (56c5dc63)
  • runtime: No command line from a frame that has returned (7aa39838)
  • compiler: Objects in a frame are no roots to visit (84cbb7c7)
  • natives: Kept literals in the image's data, not its heap (b44f3977)
  • entities: viewModel and weaponModel are text (25a13ffc)
  • compiler: Null given to a setter runs the setter (78e96fdb)
  • runtime: A plugin's cvar in the module's memory (037babd9)
  • compiler: A closure kept in a global stays alive (ea55f8ea)
  • compiler: A returned object literal is its interface (70c3112e)
  • entities: player.fallVelocity sets the game's own too (b2c113f9)
  • build: Reuse linked modules on the second build (dcaa1352)
  • player: Motd listeners do not hear showMotd (44e48de4)
  • cli: amxts check in a project names typecheck and build (4cab6433)
  • compiler: A template's parts live until it is joined (950eef68)
  • messages: A blocked menu message leaves the menu's keys (87d2ab2a)
  • chat: A line that does not start with a colour starts yellow (47d7f4cb)
  • server: A reload raises end, then the map's start (79b23d10)
  • lang: Sort orders by the sign of the comparator's number (c16c50ae)
  • server: A .aot read while it is written (a16271d2)
  • fs: A byte write the editor reads without an error (b83e8e32)
  • lang: Languages are the plugin's dictionaries' (36879f84)
  • lang: An empty array without its type is reported (d0046f69)
  • upgrade: A model's 0 is the empty file name (eb2ada5d)
  • upgrade: Drop the type import a give cast no longer needs (01fe96ca)
  • upgrade: Drop the core's print import once no print is left (533ae8c5)
  • upgrade: Cmd's info goes; 0.3's other breaks are listed (56e4ff90)
  • upgrade: No blank first line where an import went (92bb4871)

🔥 Performance

  • natives: ⚠️ Strings cross a native without copies (c0bcd0df)
  • events: No list copy or new Player per dispatch (fff7f2b7)
  • events: An event's written fields made on first write (9185dc15)
  • runtime: Forwards and handlers by number (c23e2fbd)
  • players: player.name read once until it changes (9a28e9bf)
  • runtime: Timers and the frame on Metamod's StartFrame (4c66bd65)
  • wamrc: A number made a cell through SSE2 on i386 (1edfe6f9)
  • runtime: Client and server events from Metamod (ef0751f5)
  • natives: Exported natives are the module's own (c5e2c6bf)
  • runtime: Call a plugin's handler directly (6560dbea)
  • runtime: Bind a timer's function once (0627a22d)
  • runtime: Optimise the module and WAMR as one (784095e8)
  • events: One object a game event, its walk inlined (321eccfb)
  • timers: A timer is its handler, no object (999c0e7a)
  • vector: X, y and z as loads and stores (e27e692f)
  • entities: A vector field in one call into the module (1e8f8ea1)
  • players: A kept name read without a call (451efb0f)
  • natives: A buffer takes the AMX heap without a call (25b4d13d)
  • natives: Text a native gives again is one string (8f13bf70)
  • build: A full build inlines small functions (8a5c996b)
  • build: The engine hooks' imports as direct calls (4bd58373)
  • players: A field's HUD message without AMX Mod X's natives (2e0492d0)
  • runtime: Small blocks on free lists, rarer collections (37c7d0cf)
  • timers: A timer is a slot the module hands out (22c2beea)
  • players: Health read without AMX Mod X's call (8e3307f1)
  • natives: Thunks hand their cells straight on (e256878d)
  • compiler: Calls keep only the frames and checks they need (ee0d89d8)
  • runtime: Less between a hooked call and the plugin (1f689378)
  • events: A server event is one object, read from its call (1f5132d4)
  • natives: Text comes back counted, a field's message in one call (1067755b)
  • compiler: A vector in one allocation, in its frame (b91d8d11)
  • natives: Text crosses a native four bytes at a time (62e6db69)
  • commands: A command's words read when asked (6111021a)
  • menus: The page drawn last is sent again (c525a0ea)
  • fields: A vector read in a call that collects nothing (dfa33ca0)
  • compiler: An empty frame dropped, objects zeroed once (4973eb28)
  • natives: Leaf natives take literals as kept cells (9bdebb4b)
  • commands: A command found and run with less work (90ad0b6a)
  • module: A forward's one listener called from its hook (bf797e65)
  • natives: Variadic calls built without allocating (588cd96e)
  • commands: A command run without its closure or read_argc (78b635b2)
  • api: Text the game cannot have changed is kept (aa375be4)
  • commands: A handler declared by name called directly (02b17048)
  • wamr: A whole-number check as one cvttsd2si (2259e9c5)
  • compiler: An options literal in the caller's frame (70d16418)
  • compiler: A literal's fields stored, its object zeroed in part (4d1b0c76)
  • linux: The module optimised across files, as on Windows (825e3211)
  • menus: A Menu shown again rebuilds nothing (84cbace4)
  • compiler: Whole numbers kept in i32 (6820f5a6)
  • menus: A Menu's key read off its page (ea50e297)
  • linux: Numbers made whole without the x87's rounding (79fa59be)
  • hooks: An event's objects made on its first listener (ec5b0684)
  • api: A chat message through the engine (74163bbe)

💅 Refactors

  • natives: A bot's move crosses as cells (c914f9ad)

📖 Documentation

  • One module, no host plugin (98990e6a)
  • pawn: The "From Pawn" page (b3cc7fc7)
  • api: The Pawn natives trace.line and plugin.call stand for (f4236f44)
  • players: authKey through Reunion's API (c0d96c9f)
  • menus: Several menus, actions and placeholders at once (2714a170)
  • menus: Showing the menu a player is on (51a6b9d3)
  • menus: ADMIN and ACCESS_ADMIN are built in (434c1803)
  • pawn: The From Pawn pages as the coverage writes them (9cba3b49)
  • cli: The dev panel, amxts rcon and the update line (eea6c15f)
  • modules: A Record and a rest parameter cross between plugins (b605647a)

⚠️ Breaking Changes

  • commands: ⚠️ Commands in the module, bot.command (c1e439af)
  • events: ⚠️ Game events through the module's own hooks (487725b6)
  • events: ⚠️ Messages, log and cvars through the module (277d3e96)
  • runtime: ⚠️ The module alone, without the host plugin (289aaa59)
  • api: ⚠️ The 0.3 API - plugins, storage, traces, messages (c4aa1d13)
  • server: ⚠️ A server loads only .aot (b94dbe87)
  • api: ⚠️ player.print, no free print (d7fcf7a7)
  • natives: ⚠️ Strings cross a native without copies (c0bcd0df)

❤️ Contributors

📦 Files

  • amxts-server-windows-x64.zip, amxts-server-linux-x64.tar.gz - the server kit: the module and an example plugin, hello.aot.
  • amxts_amxx.dll, amxts_amxx_i386.so - the module alone.
  • wamrc-* - WAMR's AOT compiler, per system, which @amxts/wamrc-<system> carries for npx amxts build.
  • amxts-windows.json, amxts-linux.json - what each was built from, with every file's sha256.
amxts

v0.2.4

compare changes

Summary

A fix for a project that began on an amxts whose API lived in the plugins folder: its plugins/ still held that API's files (constants.ts, facade.ts and the rest), and the build took each for a plugin, so npx amxts upgrade ended with constants does not compile. The upgrade removes those copies and names them; the build leaves them out with a warning. An author's own file of such a name is kept.

⬆️ Upgrade guide

npx amxts upgrade in the project, with the server stopped: it moves @amxts/core to 0.2.4, removes the old API copies from plugins/, builds the plugins again and puts the 0.2.4 module on the server named in .env. A server installed by hand takes the module (and amxts-compile, where it has one) from this release, and its plugins are built again.

🩹 Fixes

  • build: Old copies of amxts's API are not plugins - the build leaves them out of plugins/ and says to delete them, and the modules stay prebuilt (22303d7, 7ec565c)
  • upgrade: npx amxts upgrade removes the old copies of amxts's API from plugins/, after rewriting the imports of them (634912c)

❤️ Contributors

📦 Files

  • amxts-server-windows-x64.zip, amxts-server-linux-x64.tar.gz - the server kit: the module, and the compiler for .ts plugins written on the server.
  • amxts_amxx.dll, amxts_amxx_i386.so - the module alone.
  • amxts-compile-*, wamrc-* - the on-server compiler and WAMR's AOT compiler, per system.
  • amxts-windows.json, amxts-linux.json - what each was built from, with every file's sha256.
amxts-cli

v0.2.1

compare changes

Summary

A project's tests run without Bun: a project or module made with npm, pnpm or Yarn tests on Node with Vitest, and amxts test runs the project's Vitest when it has one. With Bun nothing changes. It goes with @amxts/core 0.2.3, whose fake server loads under Node.

🩹 Fixes

  • create: Tests on Vitest without Bun - a project or module made with npm, pnpm or Yarn tests on Node with Vitest; with Bun nothing changes (463c8f9)
  • test: The project's Vitest when it has one - amxts test runs vitest run in a project with vitest installed, else bun test (1184a2e)

📖 Documentation

  • readme: The hint for an older core (b795531)

❤️ Contributors

amxts

v0.2.3

compare changes

Summary

A fix for a plugin that gives items on playerSpawn: when a bot took the slot of a player who had left the map, the game spawned it before it counted it in again, so the listener ran for a player ReAPI still counted out. Every ReAPI native it called then failed with player N is not connected, which the server log showed as run time errors of amxts_host.amxx. Such a spawn no longer reaches the listeners; the bot's next spawn does, as before.

A plugin's tests on the fake server run under Node with Vitest as well as under bun test: @amxts/core/test-utils loaded only under Bun.

⬆️ Upgrade guide

npx amxts upgrade in the project, with the server stopped: it moves @amxts/core to 0.2.3, builds the plugins again and puts the 0.2.3 module on the server named in .env. A server installed by hand takes the module (and amxts-compile, where it has one) from this release, and its plugins are built again.

To run an existing project's tests on Node: npm i -D vitest, import test and expect from vitest instead of bun:test, and npx amxts test (@amxts/cli 0.2.1) runs Vitest.

🩹 Fixes

  • hooks: No playerSpawn for a player counted out - a bot that takes the slot of one who left the map no longer reaches the listeners while ReAPI's natives refuse it (0d7ce9f)
  • testing: A plugin's tests run under Node - @amxts/core/test-utils loads under Vitest as under bun test (4917b15)

❤️ Contributors

📦 Files

  • amxts-server-windows-x64.zip, amxts-server-linux-x64.tar.gz - the server kit: the module, and the compiler for .ts plugins written on the server.
  • amxts_amxx.dll, amxts_amxx_i386.so - the module alone.
  • amxts-compile-*, wamrc-* - the on-server compiler and WAMR's AOT compiler, per system.
  • amxts-windows.json, amxts-linux.json - what each was built from, with every file's sha256.
amxts

v0.2.2

compare changes

Summary

A fix for a server that crashed at start on some AMX Mod X builds: the module registered its server commands with fewer arguments than AMX Mod X reads, and AMX Mod X read a command's description from leftover memory. Whether it crashed depended on the AMX Mod X build and the plugins loaded - most often with one or two plugins. The server suites run on AMX Mod X 1.9 and the newest 1.10 as well from now on.

⬆️ Upgrade guide

npx amxts upgrade in the project, with the server stopped: it moves @amxts/core to 0.2.2, builds the plugins again and puts the 0.2.2 module on the server named in .env. A server installed by hand takes the module (and amxts-compile, where it has one) from this release, and its plugins are built again.

🩹 Fixes

  • runtime: No crash at start on some AMX Mod X builds: every native the module calls - register_srvcmd, register_clcmd, set_task, RegisterHam - gets all its parameters (c02eb1e)

❤️ Contributors

📦 Files

  • amxts-server-windows-x64.zip, amxts-server-linux-x64.tar.gz - the server kit: the module, and the compiler for .ts plugins written on the server.
  • amxts_amxx.dll, amxts_amxx_i386.so - the module alone.
  • amxts-compile-*, wamrc-* - the on-server compiler and WAMR's AOT compiler, per system.
  • amxts-windows.json, amxts-linux.json - what each was built from, with every file's sha256.
amxts

v0.2.1

compare changes

Summary

Fixes for 0.2.0: a plugin's call could fail at random when a native wrote into a buffer near the end of its memory, a build after an upgrade could keep plugins of the old version that the new module refuses, amxts upgrade rewrote the module's own files when the project lives in the server's folder, and the editor marked error.message in a catch as an error.

⬆️ Upgrade guide

npx amxts upgrade in the project: it moves @amxts/core to 0.2.1, builds the plugins again and puts the 0.2.1 module on the server named in .env. A server installed by hand takes the module (and amxts-compile, where it has one) from this release; the plugins are built again, since the module loads only plugins of its own release.

🩹 Fixes

  • module: Start on a server with an older Visual C++ runtime: the network thread's lock crashed Windows servers whose msvcp140.dll predates Visual Studio 2022 17.10 (04dbe6b)
  • runtime: A native whose array size the include does not give - get_players, which server.players calls, among them - no longer fails the plugin's call when the array lies near the end of the plugin's memory (e5dee94)
  • editor: catch (error) reads error.message without a cast, as the compiler and the docs do (d2875cf)
  • build: A plugin is compiled again when the core's version changes: after an upgrade the build cache could hand back a plugin of the old version, which the new module refuses (7abae6c)
  • upgrade: The module's own files are left alone - the API it writes into addons/amxts/plugins/ - when the project lives in the server's folder (c400c24)
  • testing: The test server raises configsQueued and configsExecuted when the map starts, as AMX Mod X does (2be9123)

❤️ Contributors

📦 Files

  • amxts-server-windows-x64.zip, amxts-server-linux-x64.tar.gz - the server kit: the module, and the compiler for .ts plugins written on the server.
  • amxts_amxx.dll, amxts_amxx_i386.so - the module alone.
  • amxts-compile-*, wamrc-* - the on-server compiler and WAMR's AOT compiler, per system.
  • amxts-windows.json, amxts-linux.json - what each was built from, with every file's sha256.
amxts

v0.2.0

compare changes

Summary

0.2.0 makes a server one module to install and runs it on Valve's own HLDS as well as ReHLDS. Plugins get commands with typed arguments, menus, fetch, FTP and SFTP, bots, game messages by name, errors that point at their TypeScript, and names in the player's words. A 0.1.0 project moves over with amxts upgrade.

✨ Highlights

One module to install

A server needs the addons/ folder of the server kit and one line in modules.ini:

amxts_amxx

Nothing goes into plugins.ini: the module brings its host plugin itself, writes it next to AMX Mod X's plugins when it starts, and removes it when it stops. An install from 0.1.0 can drop its amxts_host.amxx line; the console says so once.

Plain HLDS

amxts runs on Valve's own HLDS as well as on ReHLDS. The same plugin works on both, unchanged:

  • every property of an entity and a player;
  • the game events Ham Sandwich shares with ReAPI - takeDamage, spawn, killed, jump and more;
  • rounds (newRound, roundStart, roundEnd), spawns, purchases, money and the bomb, heard through the game's own log lines and messages - after the fact, so preventDefault() on them says once that it cannot stop them.

What plain HLDS cannot give at all - ReGameDLL's own functions - prints one line in the console when a plugin listens for it, and a project with target: "hlds" does not build with such a listener. Each event's page says how it behaves on plain HLDS.

Faster properties

entity.origin, player.health, player.money and every other field are read and written where the game keeps them, on both servers, without a native call. A field the player sees on the HUD - money, the armor type, the flashlight's battery, night vision, the defuse kit - is sent to the player as the game sends it.

Commands with typed arguments

The usage is the command's help and its parser at once: <name> is required, [name] optional, and the interface you name says what each one is.

interface KickArgs {
    target: Player;
    reason?: string;
}

server.addCommand<KickArgs>("/kick <target> [reason]", ({ player, target, reason }) => {
    target.kick(reason ?? `Kicked by ${player.name}`);
}, { access: "Kick", description: "Kick a player" });
  • a Player is found by #userid, by the whole name or by a part of it;
  • a number is parsed, a union of words is one of them, the last text argument takes the rest of the line;
  • a player nobody's name matches, several whose do, or a word too many answers the one who typed it with the usage, and the handler does not run;
  • without the type argument every argument is text.

player is always the one who typed the command. server.commands lists every command with its usage, description and access, for a /help of your own.

Menu is AMX Mod X's own menu - number keys, pages with Back and More, Exit - written as objects. Each item has a title, and may say when it is shown (visible) and when it can be chosen (enabled, drawn grey otherwise); both are asked again at every show, for the player it is shown to. Choosing an item runs its onSelect and closes the menu.

const shop = new Menu("Shop");

shop.addItem({
    title: "Armor - $1000",
    enabled: ({ player }) => player.money >= 1000,
    onSelect: ({ player }) => {
        player.armor = 100;
        player.money -= 1000;
    },
});

shop.addItem({
    title: ({ player }) => `Heal (${player.health} HP)`,
    visible: ({ player }) => player.isAlive,
    onSelect: ({ player }) => {
        player.health = 100;
    },
});

server.addCommand("/shop", ({ player }) => shop.show(player));

A menu of the players on the server is a loop over server.players, one item for each. The official @amxts/menu-core takes the same shape in code - menus.create(...), addItem({ title, visible, enabled, onSelect }) with ({ player }) - and adds menus read from INI, YAML or JSON files, named conditions and actions, and lists with a row per player (({ player, target })).

fetch and useFetch, as in the browser

HTTPS, redirects, timeouts and retries, on a thread of their own, so the game never waits. useFetch never throws: it gives back data (the JSON, read as the type you name), error and status.

interface Weather {
    temperature: number;
}

server.addCommand("/weather", async ({ player }) => {
    const { data } = await useFetch<Weather>("https://api.example.com/weather", {
        query: { city: "Riga" },
        timeout: 5000,
        retry: 2,
    });

    if (data) print(player, `${data.temperature}°`);
    else print(player, "The weather service is not answering");
});

fetch is the browser's own beneath it, for a raw Response, headers and streams.

@amxts/ftp

A new official module: FTP, FTPS and SFTP, since game hosts give access to a server by those. Every call is a promise on the same network thread as fetch; files go between the game folder and the other server whole, binary included (maps, demos), without passing through the plugin.

import { ftp } from "@amxts/ftp";

const client = await ftp.connect("sftp://backup@example.com", { password: settings.password });
await client.upload("addons/amxmodx/logs/today.log", "logs/today.log");
await client.download("/maps/de_dust2.bsp", "maps/de_dust2.bsp");
const entries = await client.list("/configs");
await client.close();

SFTP takes a password or an RSA key, and can check the host's key. Keep the password in a config, not in the code.

Bots

A fake client is a player like any other: it is in server.players, it joins a team, it can be kicked. It has no AI of its own; move drives it, one frame at a time.

const bot = server.addBot("Spectator");   // Player | null when the server is full
bot?.joinTeam("SPECTATOR");

const runner = server.addBot("Runner");
server.addEventListener("frame", () => runner?.move({ forward: 250, buttons: ["jump"], angles: [0, 90, 0] }));

The natives with a ... tail - engfunc, dllfunc, pev, ExecuteHam and the rest - take text, floats and vectors as well as numbers, and what a native writes back is read through Ref:

const id = engfunc(EngFunc_CreateFakeClient, "Dummy");
const reason = new Ref("");
dllfunc(DLLFunc_ClientConnect, id, "Dummy", "127.0.0.1", reason);

Game messages by name

A message the game sends a player is heard by its name, in the player's words, with typed fields:

server.addMessageListener("death", (event) => {
    if (event.headshot) print(0, `${event.killer?.name} - headshot - ${event.victim?.name}`);
});

server.addMessageListener("progressBar", (event) => {
    console.log(`a bar for ${event.seconds} s, from ${event.startPercent}%`);
});

Every message has a description, with the game's own name (DeathMsg, BarTime) beside it, so a Pawn author finds it. Where the game sends one thing in several messages, one name hears them all: progressBar (from zero or from a percent), spectatedHealth (the health of the player a spectator watches), hint (the hint box, with or without texts put into it). player.screen.progressBar(5, { startPercent: 40 }) shows one.

Errors that point at your code

When a call fails - a null read with !, an error nobody catches, a stack overflow - the console prints the TypeScript stack, file, line and column, with the source line itself:

[amxts] shop.aot: TypeError: Unexpected 'null'
    at price (plugins/shop/shop.ts:26:9)
      26 |   return item!.price;
    at onSelect (plugins/shop/shop.ts:30:15)

console.error(error) and error.stack give the same stack. The map from the plugin's code to its TypeScript travels inside each .aot; the source line appears where the .ts is next to the plugin, as in amxts dev.

Names in the player's words

The API speaks the way players and plugin authors do, not the way the game's source does:

0.1.00.2.0
Player.all()server.players
player.accountplayer.money
restartRound, onRoundFreezeEndnewRound, roundStart
flPlayerFallDamage, fPlayerCanTakeDamagefallDamage, canTakeDamage
fireBullets3shoot
game.c4Guy, game.numCtWinsgame.bomber, game.ctWins
server.addEventListener("message:DeathMsg", ...)server.addMessageListener("death", ...)
buttons: ["Jump"], access "Kick"buttons: ["jump"], access "kick"

Game messages have named, typed fields too: event.killer, event.victim, event.headshot on DeathMsg. Fields that mean nothing to a plugin - the AI members of a player, Condition Zero's career - are left to @amxts/core/natives.

amxts upgrade rewrites a 0.1.0 project: imports, command handlers, Player.all and every renamed field and event. What it cannot be sure of, it lists.

⚠️ Breaking changes

  • Player.all(filter) is server.players; filter it with .filter(...).
  • Renamed fields and events: player.account is player.money; restartRound, onRoundFreezeEnd and addAccount are newRound, roundStart and addMoney; fireBullets3 is shoot; about a hundred more follow the same rule (the full list is in amxts upgrade's output). Internal fields left the API and are reached through @amxts/core/natives.
  • A command's handler takes one object: ({ player }) => ..., not (player, args) => ....
  • @amxts/core/http is gone: fetch and useFetch are globals. easy_http is no longer needed on the server.
  • The core's API is imported by its package name (@amxts/core/natives, /fs, ...); ~/ is the project's own files only.
  • Game messages are heard with server.addMessageListener(name, ...), by their new names; the message: prefix of addEventListener is gone.
  • The names of every flag set are lowerCamelCase: "jump", "muzzleFlash", "kick".
  • @amxts/menu-core's code API takes one options object and one context: addItem({ title, onSelect: ({ player }) => ... }).
  • The module and amxts-compile must come from the same release: the module refuses a compiler of another build.
  • A plugin's id is steamId, not authid; server events are named as authors say them: putInServer, configsExecuted, pluginsLoaded, changeLevel.
  • A plugin built by 0.1.0 is not loaded: the console names it and says to build it again.

⬆️ Upgrade guide

From 0.1.0, update the command first, with the package manager the project uses: npm install @amxts/cli@latest, bun add @amxts/cli@latest, pnpm add @amxts/cli@latest or yarn add @amxts/cli@latest. Then run npx amxts upgrade in the project: it updates the packages, rewrites the code, builds, and updates the server named in .env.

🧭 Known issues

  • On plain HLDS, rounds, purchases, money and the bomb are heard after the fact; preventDefault() on them says once that it cannot stop them. ReGameDLL's own functions are not heard at all.
  • A stack shows the source line only where the plugin's .ts is next to it; in a full build, small functions are inlined and a frame may show its caller's name.
  • SFTP keys are RSA in PEM; Ed25519 and ECDSA keys are not read.

🚀 Enhancements

  • One module to install: the host plugin comes inside amxts_amxx
  • Plain HLDS: fields read in memory, a player's events through Ham Sandwich, rounds, spawns, purchases, money and the bomb through the game's own logs and messages
  • target: "hlds" stops a build that listens for what plain HLDS cannot hear
  • commands: Typed arguments, and server.commands for a /help
  • menus: Menu over AMX Mod X's menus
  • fetch: fetch and useFetch as globals, over libcurl and mbedTLS inside the module
  • kit: request over HTTP, FTP, FTPS and SFTP, for modules
  • modules: Library packages, compiled into each plugin that imports them
  • @amxts/ftp among the official modules
  • messages: Every known game message's arguments typed and named
  • events: Enum arguments of game events as names; a game event's vector arguments writable
  • players: server.players replaces Player.all
  • api: Fields and events in the player's words; internal ones left to @amxts/core/natives
  • runtime: A failed call prints the TypeScript stack, from a map carried in each plugin
  • module: A reload removes the old plugin's timers and hooks
  • module: A compiler of another build is refused, with one clear line
  • module: A plugin built for another amxts is refused, not run
  • players: server.addBot and bot.move; a fake client joins the spectators on both servers
  • natives: A native's ... tail takes text, floats, vectors and players; Ref reads what it writes back
  • messages: server.addMessageListener by the player's names, with a description for each
  • entities: A field the HUD shows is sent to the player when written
  • build: AMXTS_SERVER may name the server's root or its cstrike folder
  • server: amxts_load, amxts_unload and amxts_reload <plugin> for one plugin; amxts_plugins shows each one's state
  • dev: Saving a plugin reloads only the plugins that changed, and a menu it made stays open through the reload
  • natives: Reunion, VTC, ReChecker and GeoIP natives; player.authType, protocol and authKey from Reunion
  • modules: A shared module hears when a plugin that uses it stops (onPluginStop), and drops what it gave
  • menu-core: The code API in the same shape as Menu
  • The core's API by its package name: @amxts/core/natives, /constants, /fs, /os, /kit, /check
  • upgrade: amxts upgrade rewrites imports, command handlers, Player.all and every renamed field and event
  • docker: The server image is ghcr.io/amxts/server

🔥 Performance

  • build: Modules from npm come with their analysis, not compiled again
  • build: Plugins compile in parallel
  • build: Each file is read once per build

🩹 Fixes

  • module: The API files are written only when they changed (#1)
  • compiler: boolean | function fields, has ? get : fallback, a caught error read off a return, new Map(entries) and new Set(values), narrowing on assignment
  • commands: Typed arguments go where their interface does
  • editor: Date.UTC with fewer arguments
  • host: A missing native answers 0 and says so once
  • events: Removing the last listener switches its hook off
  • runtime: A function a plugin hands a module at its top level is called back, and a reloaded plugin's old functions are never called
  • runtime: A plugin loaded while another one runs no longer stalls that one's await, and a reload of all loads each plugin once

❤️ Contributors

📦 Files

  • amxts-server-windows-x64.zip, amxts-server-linux-x64.tar.gz - the server kit: the module, and the compiler for .ts plugins written on the server.
  • amxts_amxx.dll, amxts_amxx_i386.so - the module alone.
  • amxts-compile-*, wamrc-* - the on-server compiler and WAMR's AOT compiler, per system.
  • amxts-windows.json, amxts-linux.json - what each was built from, with every file's sha256.
ftp

v0.1.0

The first release: FTP, FTPS and SFTP for amxts plugins. Upload, download and list files on another server; every call is a promise on amxts's network thread, so the game never waits, and files go between the game folder and the other server whole, binary included.

import { ftp } from "@amxts/ftp";

const client = await ftp.connect("sftp://backup@example.com", { password: settings.password });
await client.upload("addons/amxmodx/logs/today.log", "logs/today.log");
await client.close();

SFTP takes a password or an RSA key in PEM, and can check the host's key.

❤️ Contributors

menu-core

v0.2.0

compare changes

Summary

menu-core for amxts 0.2.0: every menu function takes the menu's context, items take one options object as the core's Menu does, and a menu stays open while its plugin reloads.

✨ Highlights

The menu's context

A title, visible, enabled and onSelect take one object, { player, target, row, menu }:

const shop = menus.create("SHOP", { title: ({ player }) => `Shop - $${player.money}` });

shop.addItem({
    title: ({ player }) => `Heal (${player.health} HP)`,
    visible: ({ player }) => player.health < 100,
    onSelect: ({ player }) => {
        player.health = 100;
    },
});

In a list of players, target is the player of the row.

A menu kept through a reload

When the plugin that made a menu reloads - a save under amxts dev, amxts_reload - a player looking at the menu keeps it, on the same page, drawn from the new code. When the plugin is unloaded, its menus, items, placeholders and conditions go with it.

⚠️ Breaking changes

  • Every function a menu takes gets the context object: ({ player }) => ..., not (player) => ....
  • addItem takes one options object: addItem({ title, onSelect }), not addItem("Title", { onSelect }).
  • Conditions registered by name keep their (player, viewer, name) arguments.

⬆️ Upgrade guide

npx amxts upgrade rewrites both: the functions to the context and addItem to its options. Files of menus (INI, YAML, JSON) do not change.

📦 Dependencies

PackageFromTo
@amxts/core^0.1.0^0.2.0
@amxts/config-core^0.1.0^0.1.1

🚀 Enhancements

  • ⚠️ Every menu function takes the menu's context (496431b)
  • Keep a menu open through its plugin's reload (1a3ab54)

🩹 Fixes

  • The plugin's version is the package's (a646c2c)
  • Drop what a stopped plugin gave the menus (fa68648)

💅 Refactors

  • Import the core's API by its package name (d838de0)
  • Command handlers take one object (c6aa029)
  • server.players over Player.all (0a8c748)
  • Admin right by its lowerCamelCase name (13b2645)
  • Hear putInServer by its new name (ac6243e)

📖 Documentation

  • The player's money is player.money (0e0f3ca)
  • The Pawn natives without a plugin the reader never met (d320b06)
  • The menu's context in the README (ffe1920)
  • The README without a status note (ee841d7)

⚠️ Breaking Changes

  • ⚠️ Every menu function takes the menu's context (496431b)

❤️ Contributors

resemiclip

v0.1.1

compare changes

Summary

resemiclip for amxts 0.2.0. Its API is unchanged; the rule a plugin sets goes when that plugin stops, so ReSemiclip gets its own rules back.

⚠️ Breaking changes

None in resemiclip itself; it needs @amxts/core 0.2.

⬆️ Upgrade guide

npx amxts upgrade in the project updates it with the core.

📦 Dependencies

PackageFromTo
@amxts/core^0.1.0^0.2.0

🩹 Fixes

  • Give the rules back when the plugin that set the rule stops (62e06a8)

💅 Refactors

  • Import the core's API by its package name (4024ec5)
  • Command handlers take one object (16b55d1)
  • server.players over Player.all (ab12133)
  • Listen to the team message by its new name (c8a31d9)
  • Hear putInServer and playerChange by their new names (9b407b7)

📖 Documentation

  • The rule goes with the plugin that set it (7a4ce5b)

❤️ Contributors

config-core

v0.1.1

compare changes

Summary

config-core for amxts 0.2.0. Its API is unchanged: a plugin that reads its configs needs nothing new.

⚠️ Breaking changes

None in config-core itself; it needs @amxts/core 0.2.

⬆️ Upgrade guide

npx amxts upgrade in the project updates it with the core.

📦 Dependencies

PackageFromTo
@amxts/core^0.1.0^0.2.0

🩹 Fixes

  • The plugin's version is the package's (c53a7ee)

💅 Refactors

  • Import the core's API by its package name (7e12991)
  • Command handlers take one object (4240f17)
  • Admin right by its lowerCamelCase name (74c8ddf)

📖 Documentation

  • The Pawn natives without a plugin the reader never met (7de1140)
  • The natives' limits without comparing to Pawn (cedf727)

❤️ Contributors

amxts-cli

v0.2.0

compare changes

Summary

The command for amxts 0.2.0. amxts upgrade moves a 0.1.0 project over in one step, and a new project starts from 0.2.0's API.

✨ Highlights

amxts upgrade

One command updates the packages, rewrites the code for the renamed API, builds, and puts the release's module, compiler and wamrc on the server named in .env, with a backup of each file it replaces. --dry-run shows what it would do; --no-server and --server-only do half of it.

A new project

hello.ts has a typed config and a menu that greets the player by name; with @amxts/menu-core, its starter menu takes the menu's context.

The server's folder

AMXTS_SERVER may name the server's root or its cstrike folder.

⚠️ Breaking changes

  • The command drives @amxts/core 0.2.x only. A 0.1.0 project runs amxts upgrade first.

⬆️ Upgrade guide

Update the command with the package manager the project uses - npm install @amxts/cli@latest, bun add @amxts/cli@latest, pnpm add @amxts/cli@latest or yarn add @amxts/cli@latest - then run npx amxts upgrade.

🧭 Known issues

  • The server step of amxts upgrade downloads the release from GitHub; without network access run it with --no-server and install the server kit by hand.

📦 Dependencies

PackageFromTo
@amxts/core^0.1.0^0.2.0

🚀 Enhancements

  • server: Take the server's folder or its cstrike (f41a1d7)
  • init: Typed config and the core's Menu in hello.ts (50a7343)
  • init: The starter menu greets by name in its title (f38a850)
  • init: The menu-core starter menu takes its context (3e590ab)
  • upgrade: One command moves a project to a release (00d3974)
  • upgrade: Each package to its own version for the core (426f2a9)
  • New modules at their version for the core (a2be088)

🩹 Fixes

  • init: knip 6 in a new project (868f2e3)
  • init: Keep a linked core's own .bin on yarn (1262f55)
  • templates: The starter hears putInServer (e20acbe)

💅 Refactors

  • Command handlers take one object (5bd680c)

📖 Documentation

  • The packages are on npm (9770340)
  • amxts upgrade in the READMEs and CONTRIBUTING (7c69105)

❤️ Contributors

amxts-vscode

v0.1.0

The first release. Install from the .vsix below: VS Code → Extensions → ··· → Install from VSIX. On Open VSX (Cursor, VSCodium, Windsurf): search for amxts.

amxts

v0.1.0

amxts 0.1.0