Skip to content

Chat Categories

Chat Categories

Categories are the tabs in the chat input. Each one is a separate channel with its own colors, tags, permissions, delivery rules and identity badges. They are defined in shared/config/categories.lua as config.chatCategories.

The built-in Commands tab

A command category is always injected as the first tab at runtime (from shared/main.lua) — you do not define it yourself:

shared/main.lua
table.insert(config.chatCategories, 1, {
    label = "CATEGORY_COMMANDS_LABEL",
    type = "command",
    icon = "terminal",
    placeholder = "CATEGORY_COMMANDS_PLACEHOLDER",
})

Anything typed in this tab is executed as a command. With config.allowNoSlashCommands = true, a known command name works with or without a leading slash (typing me hi runs /me hi).

What ships enabled

Out of the box only the Admin category is active in config.chatCategories. Ready-to-use examples for OOC (Global), OOC (Local/closest), Police, EMS and Gang are included in the file but commented out — uncomment and tune them as needed.

Category type How access is gated
Commands command 항상 표시됨 (자동 주입)
Admin admin ACE 권한 command / admin / adminchat
OOC (Global) ooc 모든 사용자에게 개방 (예시)
OOC (Local) oocclosest 근접 거리 — 미터 단위의 distance (예시)
Police pdchat jobs = { police = {...grades} } (예시)
EMS emschat jobs = { ambulance = true } (예시)
Gang gang gangs = { ... } (예시)

Default category

config.defaultChatCategory decides which tab is focused when chat opens:

shared/config/general.lua
config.defaultChatCategory = "command"

Slash vs. no-slash commands

shared/config/general.lua
--- true  = commands work WITH and WITHOUT a leading slash ("me hi" runs /me)
--- false = commands only trigger with a leading slash ("/me hi")
config.allowNoSlashCommands = true

Category parameters

Every category supports a rich set of fields. A trimmed example:

shared/config/categories.lua
{
    label = "CATEGORY_ADMIN_LABEL",  -- translation key for the tab name
    type = "admin",                  -- unique id for this category
    icon = "shield-alt",             -- FontAwesome icon
    webhookKey = "chatMessage",      -- Discord log webhook (see Discord Logging)
    placeholder = "CATEGORY_ADMIN_PLACEHOLDER",
    permissions = { "command", "admin", "adminchat" }, -- required ACE perms
    maxLength = 500,                 -- max message length
    tags = {                         -- fixed tag(s) shown before the message
        { tag = "Admin", textColor = { 51, 51, 51 }, bgColor = { 255, 105, 97 } },
    },
    color = { 255, 105, 97 },        -- default message text color
    showPlayerName = { active = true, censored = false, showWearingMask = true },
    showPlayerId   = { active = false, type = "serverId" },
    showPlayerJob  = { active = false, showLabel = true, showGrade = false },
    discordTag     = { active = false, maxShow = 1, roles = { ... } },
    showHour       = { active = true },
}

Full field reference (all optional unless noted):

Field Type Description
label string 탭 표시 이름을 위한 번역 키
type string 필수. 해당 카테고리의 고유 식별자
icon string FontAwesome 아이콘 이름
webhookKey string 이 카테고리의 메시지를 기록할 디스코드 웹훅 키
command string / string[] 이 카테고리로 라우팅되는 채팅 명령어
placeholder string 입력창 플레이스홀더를 위한 번역 키
distance number 미터 단위의 최대 전달 거리; 글로벌의 경우 생략
maxLength number 최대 메시지 글자 수
permissions string[] 카테고리를 보고 사용하기 위한 필수 ACE 권한
jobs table 필수 직업 — true = 모든 등급, number[] = 특정 등급
gangs table 필수 갱 — jobs와 동일한 구조
tags table[] 메시지 앞에 표시되는 고정 태그 (tag, textColor, bgColor)
color RGB 기본 메시지 텍스트 색상 { r, g, b }
showPlayerName table active, censored, bgColor, textColor, showWearingMask
showPlayerId table active, type = "serverId", 색상
showPlayerJob table active, showLabel, showGrade, 색상, 직업별 오버라이드
discordTag table active, maxShow, roles[] (디스코드 역할 → 태그)
showHour table active, 색상 — 메시지 전송 시간 추가

이름 검열은 마스킹된 이름(예: J*** D**)을 표시합니다. 플레이어가 마스크를 착용하고 있는 경우, showWearingMask = true로 설정되어 있지 않으면 이름이 Unknown으로 숨겨집니다. 마스크 확인은 general.luaconfig.noneMask에 의해 작동합니다.