ระบบภาคสนามตั้งหลักที่ config/customer/01_police.lua ส่วนสิทธิ์ตามยศอยู่ Config.Management.RankPermissions
Duty#
ตั้ง Mode, จุดเข้าเวร, prop และ Loadout ที่ Config.Duty ระบบ Server เป็น authority สำหรับสถานะเข้าเวรและการมอบ loadout
Search#
Config.Search ควบคุม RequireOnDuty, Distance, SearchType, การ route ของกลางเข้า Agency Safe และ VehicleTrunkSeizure การเชื่อม Inventory ให้แก้ Adapter ไม่แก้ Core
Cuff / Item ปลดกุญแจมือ#
Animation ที่ลูกค้าปรับได้อยู่ Config.CuffAnimation ส่วน policy ของกุญแจมืออยู่ Config.Cuff และ technical flags/load timeout อยู่ Internal
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 อย่างเดียว
ถ้า 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 ที่เกี่ยวข้อง#
-- Client
exports['nX_police']:OpenQuickMenu()
-- Server permission check
local canSearch = exports['nX_police']:HasAbility(source, 'search')