Overview
commands.lua defines the Commands class and its single entry point Commands:OnPlayerChat(keys). All player-typed commands are routed through this function.
Entry point
Commands:OnPlayerChat(keys)
keys.playerid — the player who typed the messagekeys.text — the raw chat string (lowercased before processing)
Parsing rules
You can target another player by including
#<playerID> anywhere in the message:
-pid first to discover player IDs.
The IsCommand closure
Inside OnPlayerChat, a local closure is created to do prefix-matched command detection:
-ar matches -antirat and -antirat both match IsCommand("-ar").
Vote commands
Vote commands require a threshold percentage of players to accept before taking effect. They useutil:CreateVoting(...) internally.
Vote thresholds depend on the map:
all_allowedmap: some votes require only 50 % (e.g.-antirat,-doublecreeps,-enablefat,-enablerefresh)- All other maps: 100 % required
Debug commands
Always available regardless of cheat mode:Cheat commands
Cheat commands are only available whenutil:isSinglePlayerMode() is true or Ingame.voteEnabledCheatMode is true.

