Knight Knight
EN ID Install

Knight Programming Language

The languagethat runsyour server

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.

minimal.sa
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; }
    }
};

Install

macOS / LinuxWindows
$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().

Features

View Docs
#1 Write

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.

#2 Call

Native-first API

SetPlayerHealth(playerid, 100.0) by name. There is no sa. prefix, no self and no bindings layer.

#3 Check

Types before runtime

Typed parameters, default values, rest parameters and optional annotations, all caught at compile time with line:column.

#4 Flow

Real control flow

while, do..while, for, for..in over arrays and maps, switch without fall-through, break and continue.

#5 Grow

Modules and plugins

Split a gamemode into modules, load .sa plugins without rebuilding, or write a Go plugin for native-speed features.

#6 Connect

Custom RPC

Register your own RPC ids, read binary payloads safely and filter by priority, size and rate.

FAQs

View Docs
What is Knight?

A from-scratch SA-MP 0.3.7 / 0.3.DL server written in Go, with its own statically-typed language for gamemodes.

Do I need Pawn?

No. Gamemodes are .sa files. There is no AMX, no compiler and no include chain to maintain.

Is server.cfg required?

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.

How many functions are there?

559 natives, 69 built-ins and 41 callbacks, all documented with signatures.

Can I add my own packets?

Yes. HandleCustomRPC and HandleRPC register RPC ids for a client mod, with size and rate limits enforced by the engine.

Is it free?

Yes. The server, the language and the documentation are open source.