ระบบภาคสนามตั้งหลักที่ config/customer/01_police.lua ส่วนสิทธิ์ตามยศอยู่ Config.Management.RankPermissions

Duty#

ตั้ง Mode, จุดเข้าเวร, prop และ Loadout ที่ Config.Duty ระบบ Server เป็น authority สำหรับสถานะเข้าเวรและการมอบ loadout

Config.Search ควบคุม RequireOnDuty, Distance, SearchType, การ route ของกลางเข้า Agency Safe และ VehicleTrunkSeizure การเชื่อม Inventory ให้แก้ Adapter ไม่แก้ Core

ของกลาง
Search/Vehicle Storage ต้อง remove จากเจ้าของสำเร็จก่อน commit เข้าหน่วยงานและบันทึก evidence

Cuff / Item ปลดกุญแจมือ#

Animation ที่ลูกค้าปรับได้อยู่ Config.CuffAnimation ส่วน policy ของกุญแจมืออยู่ Config.Cuff และ technical flags/load timeout อยู่ Internal

lua
Config.Cuff = {
    AutoUncuffOnDeath = true,
    UnlockItem = {
        Enabled = false,
        Item = 'handcuff_key',
        Amount = 1,
        ConsumeOnUse = false,
        AllowSelfUse = true,
        RequireForPoliceUncuff = false
    }
}
  • Self use: เมื่อ Enabled=true + AllowSelfUse=true ผู้ที่ถูก cuff สามารถกดใช้ item เพื่อปลดตัวเองได้
  • Police uncuff: ถ้า RequireForPoliceUncuff=true เจ้าหน้าที่ที่กำลังถอดกุญแจมือต้องมี item นี้
  • Consume: true = หัก item หลังตรวจครบ; false = ตรวจว่ามีแต่ไม่หัก
  • Death: AutoUncuffOnDeath=true จะ clear cuff หลัง Server ตรวจ PED ตายจริง ไม่เชื่อ client event อย่างเดียว
ค่าเริ่มต้นไม่บังคับ Item
UnlockItem.Enabled=false และ RequireForPoliceUncuff=false จึงยังใส่/ถอดกุญแจมือแบบเดิมจนกว่าจะเปิด feature เอง

ถ้า Inventory ภายนอกไม่ได้ใช้ ESX usable item ให้ Server adapter เรียก exports['nX_police']:UseCuffUnlockItem(source) โดยไม่ต้องหัก item เองล่วงหน้า

Quick Menu & Shortcuts#

Config.QuickMenu ใช้ตั้ง Command, Keybind, shortcut และ integration action รองรับ event/serverEvent/export/command แต่ resource ปลายทางต้องตรวจ permission ฝั่ง Server ของตัวเอง

Countdown#

ตั้งวินาที/ระยะ/ข้อความได้จาก Config ลูกค้า ส่วน network debounce/proximity sync เป็น Internal Runtime

Public API ที่เกี่ยวข้อง#

lua
-- Client
exports['nX_police']:OpenQuickMenu()

-- Server permission check
local canSearch = exports['nX_police']:HasAbility(source, 'search')