Skip to main content
The Chat component manages command registration, message broadcasting, and service communication (911/311 dispatch).

Overview

Access via Chat (server-side only).

Commands

Register custom chat commands

Messaging

System, OOC, and broadcast messages

Emergency Services

911/311 calls and dispatch

Staff Commands

Admin and staff command registration
Server-Side Only: All chat operations must be performed on the server.

Command Registration

Chat:RegisterCommand

Register a custom chat command accessible to all players.
string
required
Command name without the / prefix
function
required
Handler function: function(source, args, rawCommand)
table
Command suggestion shown in chat: { help = "description", params = {} }
number
Expected argument count. Use -1 for variable arguments.
table
Job requirements to use the command
Examples:

Chat:RegisterAdminCommand

Register a command that requires admin permissions.
Parameters are the same as RegisterCommand (without job). Example:

Chat:RegisterStaffCommand

Register a command that requires staff permissions.

Chat:Refresh:Commands

Refresh the command suggestion list for a specific player. Call this after duty changes or job updates.
number
required
Player server ID

Chat:ClearAll

Clear the chat for all connected players.

Message Sending

Chat.Send.Server:All

Send a server message to all players.
string
required
Message text
Example:

Chat.Send.Server:Single

Send a server message to a single player.
number
required
Player server ID
string
required
Message text

Chat.Send.System:All

Broadcast a system message to all players.

Chat.Send.System:Single

Send a system message to a single player.
Example:

Chat.Send.System:Broadcast

Broadcast a system-wide message.

Chat.Send.Broadcast:All

Send a broadcast message with an author.
string
required
Author/sender name
string
required
Message text

Chat.Send.OOC

Send an Out-of-Character message from a player.

Emergency Services

Chat.Send.Services:Emergency

Send a 911 emergency call (visible to on-duty police and EMS).
number
required
Caller’s server ID
string
required
Emergency description
Example:

Chat.Send.Services:EmergencyAnonymous

Send an anonymous 911 call.

Chat.Send.Services:EmergencyRespond

Send a 911 response to a specific caller.
number
required
Responder’s server ID
number
required
Original caller’s server ID
string
required
Response message

Chat.Send.Services:NonEmergency

Send a 311 non-emergency call.

Chat.Send.Services:NonEmergencyAnonymous

Send an anonymous 311 call.

Chat.Send.Services:NonEmergencyRespond

Send a 311 response to a caller.

Chat.Send.Services:Dispatch

Send a dispatch message to a player.

Chat.Send.Services:TestResult

Send a test result message to a player.

Best Practices


Next Steps

Chat - Events

Chat events and message types

Admin Commands

Admin command reference

Jobs API

Job system for command restrictions