Config รุ่นปัจจุบันแบ่งตามสิ่งที่ลูกค้าต้องทำจริง: customer สำหรับกติกา, data สำหรับรายการที่แก้บ่อย, locales สำหรับข้อความ และ functions สำหรับ Adapter โดย Security / Performance / Network policy อยู่ Internal

00_setup.lua — เริ่มตรงนี้#

lua
Config.General = {
    Debug = false,
    Locale = 'th',
    Jobs = { OnDuty = 'police', OffDuty = 'offpolice' },
    AdminGroups = { admin = true, superadmin = true, dev = true }
}

Config.Features = {
    Duty = true,
    Dispatch = true,
    Cases = true,
    Jail = true,
    Statistics = true
}

ไฟล์ config/customer/00_setup.lua คือ Quick Start: ตั้ง Job, Admin Groups และเปิด/ปิดระบบหลักจากจุดเดียว

config/customer — Gameplay / Policy#

ไฟล์ใช้ตั้งค่า
00_setup.luaGeneral / Features
01_police.luaDuty / Search / Cuff / Quick Menu / Countdown
02_dispatch.luaDispatch / Curfew / Squad / Helicopter Camera
03_cases_jail.luaCase policy / Jail / Escape / Jail Card / Screenshot
04_management.luaMailbox / Rank Permissions / Equipment Management
05_economy.luaBank / Welfare / Paycheck / Safe / Shop policy / Reward policy
06_services.luaReports / Announcements / Playpass / Statistics
07_ui.luaNotification / UI
08_integrations.luaAdvanced Integrations
09_doorlock.luaDoor Lock policy / permission / visual

config/data — รายการที่แก้บ่อย#

ranks.luaยศ เงินเดือน และระดับ permission
charges.luaหมวดข้อหา + ข้อหา + evidenceItems
jail_locations.luaสถานที่คุมขัง / จุดตาย / จุดออก
shop_items.luaรายการสินค้าร้านหน่วยงาน
rewards.luaรางวัลตามเวลาเข้าเวร
doors.luaรายการประตูถาวรจาก POLICE+

config/locales/th.lua — ข้อความ#

ข้อความภาษาไทยที่ลูกค้าปรับได้อยู่ไฟล์เดียว ส่วน aliases / formatter / compatibility resolver อยู่ Internal เพื่อลดข้อความซ้ำและไม่ให้ Customer Config เต็มไปด้วย source mapping

Notification Provider#

Toast ปกติเลือกใช้ของ nX Police หรือ Notify ภายนอกได้จาก config/customer/07_ui.lua โดยไม่ต้องแก้ Core

lua
Config.Notification = {
    Enabled = true,
    Provider = 'internal', -- internal / external
    Duration = 4500,
    External = {
        Resource = '',
        FallbackToInternal = true,
        TypeMap = {
            info = 'info', success = 'success',
            error = 'error', warning = 'warning'
        }
    }
}

เมื่อใช้ external ให้เชื่อม signature จริงที่ Functions.Client.ExternalNotify() ใน config/functions/client.lua และแนะนำให้เปิด FallbackToInternal เพื่อไม่ให้ข้อความหายเมื่อ Notify ภายนอก restart หรือ error

External Provider ใช้เฉพาะ Toast ปกติ ไม่แทน Dispatch Card, Jail HUD, Announcement หรือ UI เฉพาะระบบ ดูตัวอย่างเต็มที่หน้า Integrations → External Notification

Reset Statistics#

ไม่มี Config.Statistics.ResetKey แล้ว การล้างสถิติเป็นคำสั่ง Admin-only และใช้ Config.General.AdminGroups เป็น authority:

text
/nxresetstatistics
/nxresetstatistics confirm

ต้องยืนยันคำสั่งที่สองภายใน 60 วินาที ระบบมี lock กัน reset ซ้อน พร้อม Activity audit และ Discord statistics log

ค่าที่ไม่อยู่ใน Customer Config#

Rate limit, anti-spam, SQL cache, retry, timeout, OneSync tolerance, telemetry, smoothing, network protocol และ Security hard limits ถูกกำหนดฝั่ง Internal Runtime/Server Policy เพื่อไม่ให้ลูกค้าแก้พลาดและลดภาระ Support

Shared Config ไม่ใช่ Secret
ไฟล์ customer/data/locales ถูกโหลดเป็น shared script ห้ามเก็บ Webhook URL, Token, Password หรือ Secret ใด ๆ โดยเด็ดขาด