Knight docs
EN ID
GitHub

Installation

Download Knight, run the server, and validate a gamemode. No compiler toolchain, no Pawn, no server.cfg required.

A Knight server is one folder with two programs:

Note
You do not need Go, Pawn or any compiler. The gamemode is compiled by the server at startup; the validator is just an optional pre-flight check.

1. Get the files

Clone the distribution:

bash
git clone https://github.com/ventosilenzioso/knight.git
cd knight

The layout you get:

text
Bin/            knight-server (Linux) and knight-server.exe (Windows)
tools/          knight validator (Linux, macOS arm64, Windows)
Gamemodes/      ready-to-run .sa gamemodes
Gamemodes/modules/  example module and hook
server.cfg      default configuration (optional)
docs/           language, callbacks, natives, plugins, custom RPC
Tip
Only Bin/knight-server is required. Everything else is documentation and examples you can delete.

2. Run the server

Start it with a gamemode and you are online:

bash
./Bin/knight-server -gamemode Gamemodes/minimal.sa
# Windows: Binknight-server.exe -gamemode Gamemodesminimal.sa
Note
-gamemode alone is enough: server.cfg is optional. The gamemode's system::config() supplies the name, port, slots and every other setting.

Using server.cfg instead

If you prefer a file, put gamemode0 in server.cfg and start the server with no flags:

cfg
gamemode0 minimal 1
port 7777
hostname "My Knight Server"
maxplayers 50
connect_timeout 20
bash
./Bin/knight-server -cfg server.cfg

Values declared in system::config() win; server.cfg fills whatever the code leaves out.

3. Validate a gamemode (optional)

The validator catches syntax and type errors without starting a server. It resolves includes and imports and recognises plugin natives.

bash
# Linux
./tools/knight-linux-amd64 -check Gamemodes/minimal.sa
# ok: 4 events, 1 config blocks

# macOS (Apple silicon)
./tools/knight-macos-arm64 -check Gamemodes/minimal.sa

# Windows
toolsknight-windows-amd64.exe -check Gamemodesminimal.sa

-ast prints the parsed tree instead, which helps when an expression does something unexpected:

bash
./tools/knight-linux-amd64 -ast Gamemodes/minimal.sa

4. Optional: put it on PATH

So you can type knight-server from any folder. This is convenience only; the commands above work from the extracted folder without it.

Linux / macOS

bash
sudo install -m 755 Bin/knight-server /usr/local/bin/knight-server
sudo install -m 755 tools/knight-linux-amd64 /usr/local/bin/knight

# without sudo
mkdir -p ~/.local/bin
install -m 755 Bin/knight-server ~/.local/bin/knight-server
install -m 755 tools/knight-linux-amd64 ~/.local/bin/knight
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc

Windows (PowerShell)

powershell
$dir = "$env:LOCALAPPDATAKnight"
New-Item -ItemType Directory -Force -Path $dir | Out-Null
Copy-Item Binknight-server.exe "$dirknight-server.exe"
Copy-Item toolsknight-windows-amd64.exe "$dirknight.exe"

$p = [Environment]::GetEnvironmentVariable("Path", "User")
[Environment]::SetEnvironmentVariable("Path", "$p;$dir", "User")
Tip
Reopen the terminal after changing PATH. Then knight -check and knight-server work from anywhere.

5. Verify the install

There is no -version flag. Confirm the install by validating a shipped gamemode and watching the server start:

bash
./tools/knight-linux-amd64 -check Gamemodes/minimal.sa
# ok: 4 events, 1 config blocks

./Bin/knight-server -gamemode Gamemodes/minimal.sa
# gamemode loaded: Gamemodes/minimal.sa
# Knight listening port=7777 hostname="Minimal Knight"

Then connect with any SA-MP 0.3.7 or 0.3.DL client on port 7777.

6. Next steps

GoalPage
Write your first gamemodeYour First Gamemode
Learn the languageLanguage Guide
Find a nativeNative Functions
Split a gamemode into modulesModules & Imports
Enable a pluginPlugin Hub
Tune the configurationConfiguration

Common problems

ProblemFix
command not foundRun it with the ./Bin/... or ./tools/... prefix, or add the folder to PATH.
gamemode load failedThe path is wrong or the file does not compile. Run the validator on it to see the error.
bind: address already in useAnother server uses that port. Change server.port or port in server.cfg.
Player is dropped after a few secondsRaise connect_timeout (default 20) for weak mobile networks.
Permission deniedchmod +x Bin/knight-server or use sudo.
macOS: cannot be openedRun xattr -d com.apple.quarantine on the file.
Windows: knight opens the StoreDisable the App Execution Alias for knight.exe in Settings → Apps.