One file, no build
A gamemode is a single .sa file. The server compiles and type-checks it at startup, and the validator does it on demand.
Knight Programming Language
Knight is a statically-typed programming language built into the Knight SA-MP 0.3.7 / 0.3.DL server. One .sa file, native calls by name, no Pawn build step.
system::config() {
server.name = "Euporia RP";
server.max_players = 200;
};
player::spawn() {
SetPlayerHealth(playerid, 100.0);
SendClientMessage(playerid, "Welcome, {PlayerName(playerid)}!");
};
player::command("/top", int n) {
for (let i = 0; i < PlayerCount(); i += 1) {
if (!IsPlayerConnected(i)) { continue; }
if (i >= n) { break; }
}
};
curl -fsSL https://github.com/ventosilenzioso/knight.git
./tools/knight-linux-amd64 -check Gamemodes/minimal.sa
Validate a gamemode
Or download the distribution and run the server directly. server.cfg is optional: put the configuration in system::config().
A gamemode is a single .sa file. The server compiles and type-checks it at startup, and the validator does it on demand.
SetPlayerHealth(playerid, 100.0) by name. There is no sa. prefix, no self and no bindings layer.
Typed parameters, default values, rest parameters and optional annotations, all caught at compile time with line:column.
while, do..while, for, for..in over arrays and maps, switch without fall-through, break and continue.
Split a gamemode into modules, load .sa plugins without rebuilding, or write a Go plugin for native-speed features.
Register your own RPC ids, read binary payloads safely and filter by priority, size and rate.
A from-scratch SA-MP 0.3.7 / 0.3.DL server written in Go, with its own statically-typed language for gamemodes.
No. Gamemodes are .sa files. There is no AMX, no compiler and no include chain to maintain.
No. Every setting can live in system::config() inside the gamemode. A server.cfg is read when present and fills the fields the code does not declare.
559 natives, 69 built-ins and 41 callbacks, all documented with signatures.
Yes. HandleCustomRPC and HandleRPC register RPC ids for a client mod, with size and rate limits enforced by the engine.
Yes. The server, the language and the documentation are open source.