counterstrike-cn

Console

Interactive developer console with command input.

Console

The CS 1.6 developer console (opened with ~) — scrollable output area with colored message types and a command input line with the classic ] prompt.

Interactive Preview
Console~
Console initialized.
]map de_dust2
Loading map de_dust2...
Server ready.
]sv_cheats 0
Unknown command "fly"
Connection timed out
]

Usage

import { Console } from "@/components/ui/cscn/console";

<Console
  lines={[
    { text: "Console initialized.", type: "system" },
    { text: "Server using 'Counter-Strike' game rules", type: "info" },
    { text: "sv_cheats 1", type: "input" },
    { text: "sv_cheats = 1", type: "system" },
    { text: "Unknown command: noclip", type: "error" },
    { text: "SV_SpawnServer: de_dust2", type: "warning" },
  ]}
  onCommand={(cmd) => console.log("Command:", cmd)}
/>

Message Types

TypeColorUsage
infoWhiteGeneral information
systemGoldSystem/engine messages
inputAmberUser-entered commands (prefixed with ])
warningOrangeWarnings
errorRedErrors