Knight docs
EN ID
GitHub

Commands

Typed chat commands with automatic argument parsing.

Declare a command with a leading /name literal and typed arguments.

knight
player::command("/heal") {
    SetPlayerHealth(playerid, 100.0);
};

player::command("/give", int amount, string reason) {
    GivePlayerMoney(playerid, amount);
    SendClientMessage(playerid, "Received {amount}: {reason}");
};

player::command("/tp", float x, float y, float z) {
    SetPlayerPos(playerid, x, y, z);
};

How arguments are parsed

Note
Unknown commands can be handled in player::chat or left to the engine's SERVER: Unknown command reply.