ClientA connected client, identified by its 0-based slot (CPlayerSlot). Slot-backed; getters read live.
readonly slot: numberCPlayerSlot) — the handle's stable identity for its connection.isValid(): booleanreadonly steamId: stringreadonly name: stringreadonly userId: numberreadonly signonState: numberreadonly isBot: booleankick(reason?: string): voidchat(message: string): voidprint(message: string): voidreadonly ip: stringkickWithReason(reason: string, delaySeconds?: number): voidreason (chat + console) once the client is in-game, then kick after delaySeconds (default 5). Intended to be called from a Clients.onConnect handler.voiceMuted: booleancommand(cmd: string): booleanTell this client to run cmd in their own console, as if they had typed it
(SourceMod ClientCommand).
Requires a real client: a bot has no console, so this is a no-op on bots — use
Client.fakeCommand for server-side execution. Returns false when the command was not
dispatched (empty text, bad slot, or the engine interface is unavailable on this build), never
a silent no-op.
client.command("play sounds/ui/beep.vsnd");fakeCommand(cmd: string): booleanHave the SERVER process cmd as if this client had sent it (SourceMod FakeClientCommand).
Unlike Client.command this works on bots, because nothing is sent to a client — the
engine dispatches the command itself, attributed to this player's slot. Live-verified:
fakeCommand("say hi") on slot 0 prints as that player, not as Console.
Returns false — never a silent no-op — for a bad slot, empty text, an unavailable interface,
or a name that is not a registered console **command** (a ConVar such as mp_friendlyfire is
refused: use Server.command for those).
Engine commands (say, kill, …) execute. A command registered by an s2script plugin runs
that plugin's JS handler before this returns.
client.fakeCommand("say hello"); // as though the player typed it