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:
Bin/knight-server— the server. It loads a.sagamemode and runs it.- **
tools/knight-*** — the validator. It checks.safiles without starting a server.
1. Get the files
Clone the distribution:
git clone https://github.com/ventosilenzioso/knight.git
cd knight
The layout you get:
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
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:
./Bin/knight-server -gamemode Gamemodes/minimal.sa
# Windows: Binknight-server.exe -gamemode Gamemodesminimal.sa
-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:
gamemode0 minimal 1
port 7777
hostname "My Knight Server"
maxplayers 50
connect_timeout 20
./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.
# 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:
./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
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)
$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")
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:
./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
| Goal | Page |
|---|---|
| Write your first gamemode | Your First Gamemode |
| Learn the language | Language Guide |
| Find a native | Native Functions |
| Split a gamemode into modules | Modules & Imports |
| Enable a plugin | Plugin Hub |
| Tune the configuration | Configuration |
Common problems
| Problem | Fix |
|---|---|
command not found | Run it with the ./Bin/... or ./tools/... prefix, or add the folder to PATH. |
gamemode load failed | The path is wrong or the file does not compile. Run the validator on it to see the error. |
bind: address already in use | Another server uses that port. Change server.port or port in server.cfg. |
| Player is dropped after a few seconds | Raise connect_timeout (default 20) for weak mobile networks. |
Permission denied | chmod +x Bin/knight-server or use sudo. |
| macOS: cannot be opened | Run xattr -d com.apple.quarantine on the file. |
Windows: knight opens the Store | Disable the App Execution Alias for knight.exe in Settings → Apps. |