Skip to content

Konfigurasi

Konfigurasi

Konfigurasi BUPA Chat dibagi ke dalam beberapa file shared/config/*.lua. Semua file ini berada di dalam escrow_ignore, sehingga tetap dapat diedit setelah pembelian. Halaman ini membahas pengaturan umum, tampilan, emoji, emote, dan pesan. Kategori dan Discord memiliki halaman tersendiri.

Umum — general.lua

Tombol, suara, pengaturan bawaan, dan sistem masker.

shared/config/general.lua
config.chatKey = "T"            -- key to open the chat input
config.chatVisibilityKey = ""    -- key to cycle visibility mode ("" = unbound)
config.clearCommand = { "clear", "temizle" } -- commands that clear chat history
config.closeOnOutsideClick = true            -- click outside closes the input
config.typingSound = true                    -- keyboard sound while typing
config.allowNoSlashCommands = true           -- run commands without a leading slash
config.uiUpdateRate = 24                      -- ms update rate for head indicators
config.defaultAddTag = true                   -- first arg becomes a tag when no tags given
config.showPrintsOnChat = false               -- mirror server prints into chat
config.discordTagCacheTime = 60 * 60          -- Discord role cache (seconds)
config.defaultChatCategory = "command"        -- tab focused on open

Pesan bergabung / keluar mengikuti konvar standar:

lua
config.showJoinMessages = GetConvarInt('chat_showJoins', 1) == 0
config.showQuitMessages = GetConvarInt('chat_showQuits', 1) == 0

Sumber nama chat admin

Kategori admin dapat menampilkan sumber nama yang berbeda dari nama karakter:

shared/config/general.lua
config.adminChatName = {
    mode = "discord",   -- "character" | "steam" | "discord"
    discord = {
        botToken = "",  -- required for "discord" mode
        guildId  = "",
        cacheTime = 600,      -- nick cache seconds
        fallback  = "steam",  -- used when a nick can't be resolved
    },
}

Nama yang mendeteksi masker — config.noneMask

config.noneMask mencantumkan drawable masker (berdasarkan model ped, koleksi, dan indeks) yang tidak boleh menyembunyikan nama pemain di chat. Ketika aktif, nama pemain yang bermasker akan ditampilkan sebagai Unknown (Tidak Diketahui) kecuali kategori mengatur showWearingMask = true, atau masker yang dikenakan ada di dalam daftar pengecualian (allow-list) ini.

Tampilan — display.lua

Pesan pribadi — config.pm

shared/config/display.lua
config.pm = {
    active = true,
    command = { "pm", "dm" },     -- send a private message
    webhookKey = "chatMessage",   -- Discord log key
    maxLength = 300,
    sender   = { --[[ tags/color/name/id/job/discordTag/hour for the sender copy ]] },
    receiver = { --[[ same shape for the receiver copy ]] },
}

Pengirim dan penerima masing-masing memiliki gaya yang independen (tag, color, showPlayerName, showPlayerId, showPlayerJob, discordTag, showHour).

Teks di atas kepala & tampilan ID pemain

shared/config/display.lua
config.headTextMaxStack = 4      -- max head texts stacked on one player

config.playerIdDisplay = {
    active = false,              -- show IDs above heads while chat is open
    showOwn = true,             -- include your own ID
    dist = 5.0,                 -- max display distance (m)
    template = "[{serverId}] {discordId}", -- {serverId}{name}{steamId}{discordId}{fivemId}
    headText = { bone = 31086, offset = vector3(0.3, 0.0, 0.0), maxRenderDist = 30.0 },
    cssStyle = { color = "#fff", fontSize = "1.8vh", fontWeight = "600" },
}

template mendukung placeholder {serverId}, {name}, {steamId}, {discordId}, {fivemId}, pemisah baris \n, serta HTML/CSS inline.

Emoji — emojis.lua

Pemilih emoji sepenuhnya berbasis data. Setiap kategori adalah { tab = "<icon emoji>", label = "<HEADER>", list = { ... } } dan setiap emoji adalah { emoji, name, code }.

shared/config/emojis.lua
config.emojis = {
    {
        tab = "😀", label = "SMILEYS",
        list = {
            { emoji = "😀", name = "Grinning", code = ":grinning:" },
            { emoji = "😂", name = "Joy",      code = ":joy:" },
            -- ...
        },
    },
    -- GESTURES (👍), SYMBOLS (❤️), OBJECTS (🚗)
}

Dilengkapi dengan empat grup — Smileys, Gestures, Symbols, dan Objects. Tambah, hapus, atau susun ulang secara bebas; code adalah shortcode yang dapat dicari dan ditampilkan di bawah pratinjau.

Emote — emotes.lua

Indikator mengetik — config.chatOpenEmote

Titik-titik animasi di atas kepala pemain saat mereka mengetik:

shared/config/emotes.lua
config.chatOpenEmote = {
    active = true,
    texts = { { text = "•", time = 500 }, { text = "••", time = 500 }, { text = "•••", time = 500 } },
    cssStyle = { color = "#fff", fontSize = "1.6vh" },
    dist = 8.0,   -- how far others can see it (m)
}
config.emoteOneAtATime = true  -- one active instance of each emote command per player

Perintah emote — config.emoteCommands

Dilengkapi dengan /me, /do, /dice (/zar), dan /rps (/tkm). Setiap emote dapat memutar animasi, merender teks di atas kepala, dan secara opsional mencerminkannya ke chat:

shared/config/emotes.lua
{
    command = "me",
    desc = "EMOTE_ME_COMMAND_DESC",
    webhookKey = "emoteCommand",   -- Discord log (optional)
    dist = 8.0,
    time = 10000,                   -- head text duration (ms)
    template = "{text}",            -- {text} {playerName} {playerCensoredName}
    cssStyle = { color = "#b6a8ff", fontStyle = "italic" },
    sendToChat = { active = true, tags = { { tag = "ME" } }, color = { 182, 168, 255 } },
}

Field tambahan: anim (dict, clip, flag, duration), headText (bone/offset/scale), params (argumen kustom yang diketik dengan tombol bantuan) dan msgCb(args) untuk hasil yang dihitung (digunakan oleh /dice dan /rps).

Pesan — messages.lua

Siaran otomatis, pesan sambutan, dan penataan gaya event txAdmin — semuanya nonaktif secara default.

config.autoMessages = {
    active = false,
    messages = {
        { interval = 3600000, tags = { { tag = "Auto Message" } }, color = { 88, 166, 255 },
          args = { "Test message for auto message (1)" } },
    },
}

config.welcomeMessages = {
    active = false,
    messages = { { tags = { { tag = "Welcome" } }, color = { 255, 255, 255 },
                   args = { "Welcome to the BUPA Test server!" } } },
}

config.txAdmin = {
    announcement     = { active = true, tagBgColor = { 255, 190, 60 } },
    scheduledRestart = { active = true, tagBgColor = { 255,