เพิ่มประเภทเหตุ#

แก้ที่ Config.Dispatch.Types ใน config/customer/02_dispatch.lua

lua
Config.Dispatch.Types.bankrob = {
    code = '10-90',
    label = 'ปล้นธนาคาร',
    accent = '#ff4545',
    blipColor = 1,
    blipSprite = 161,
    blipRadius = 80.0
}

พฤติกรรม Dispatch ที่ตั้งได้#

ค่าผลลัพธ์
NotificationDurationMsระยะเวลาที่ Dispatch Card แสดง
BlipDurationMsระยะเวลาที่ Blip ของเหตุอยู่บนแผนที่
MaxVisibleจำนวนการแจ้งเตือน Dispatch ที่แสดงพร้อมกัน
AcceptCommandชื่อคำสั่งสำหรับรับเหตุ

Curfew#

Config.Curfew ตั้งจำนวนวงที่เปิดพร้อมกัน, HistoryLimit, radius เริ่มต้น/ต่ำสุด/สูงสุด, สี/ไอคอน Blip และลักษณะวง/กำแพงที่ผู้เล่นเห็นได้

  • AllowMultiple / MaxActive — อนุญาตหลายวงและกำหนดจำนวนสูงสุด
  • DefaultRadius / MinRadius / MaxRadius — กำหนดช่วงรัศมีเป็นเมตร
  • Blip — ตั้งสี ความโปร่งใส และ Point icon
  • WorldBoundary — เปิด/ปิดและปรับสี/ความสูง/ความโปร่งใสของขอบเขตในโลกเกม

Squad / Officer Blips#

Config.Squad ตั้งชื่อและไอคอนเจ้าหน้าที่บน Minimap/Pause Map โดยลูกค้าปรับเฉพาะการแสดงผลที่เปิดไว้ใน Config

  • ShowNames — แสดงชื่อเจ้าหน้าที่
  • Blip.Enabled / AutoVehicleBlip — เปิด Squad Blip และเปลี่ยนรูปตามยานพาหนะอัตโนมัติ
  • OnFoot / Vehicle / Helicopter / Plane — ตั้ง Sprite, Color, Scale แยกประเภท
  • DeadSprite / DeadColor / DeadScale — รูปเมื่อเจ้าหน้าที่เสียชีวิต
  • Siren — เปิด icon/radius ไซเรนและตั้ง Sprite, สี, ขนาด, Alpha และ Flash ที่ลูกค้าปรับได้

Helicopter Camera#

Config.HelicopterCamera ตั้งรถที่ใช้ได้, การบังคับเข้าเวร, ปุ่มควบคุม, FOV/Zoom/Pan, MaxTargetLockDistance, หน่วยความเร็ว และ Spotlight

Spotlight ตั้ง Enabled, Range, Brightness, Hardness, Radius และ RGB ได้; UseMilesPerHour=false ใช้ km/h และ true ใช้ mph

Client-side ReportCrime#

Client export ใช้ประเภทเหตุและเงื่อนไขตาม Config ที่เปิดใช้งาน ลูกค้าไม่ต้องสร้าง Security Config เพิ่ม

lua
exports['nX_police']:ReportCrime('cement', {
    category = 'normal',
    details = 'พบการขโมยวัสดุก่อสร้าง'
})

Server-side ReportCrime#

lua
exports['nX_police']:ReportCrime('cement', {
    source = playerId,
    category = 'normal',
    details = 'พบการขโมยวัสดุก่อสร้าง'
})

หากไม่มี Player Source สามารถส่ง coords = { x = ..., y = ..., z = ... } แทนได้

ข้อมูลที่ Client เติมให้อัตโนมัติ#

เมื่อเรียก ReportCrime จาก Client หากไม่ได้ส่งข้อมูลบริบท ระบบสามารถเติม coords, street, zone และ gender ที่รองรับให้อัตโนมัติ; ค่าที่ส่งมาเองจะถูกใช้แทน

ข้อมูลตำแหน่ง
หากส่ง Player Source ระบบจะใช้ตำแหน่งที่เกี่ยวข้องกับผู้เล่นนั้น; หากไม่มี Source ให้ส่ง coords ตามตัวอย่าง Server-side

สีตามหมวดคดี#

category อ้างอิง Config.ChargeCategories[].code ใน config/data/charges.lua และใช้สีที่ตั้งไว้ในหมวดนั้น

สีหมวดรองรับ #RRGGBB, linear-gradient(...) และ radial-gradient(...) โดยตั้งไว้ที่ข้อมูลหมวดคดีฝั่ง Server/Config เช่น:

lua
color = '#4D8DF7'
-- หรือ
color = 'linear-gradient(to right, #007aff, #5e70e3)'
-- หรือ
color = 'radial-gradient(circle at center, #007aff 0%, #101827 100%)'
ไม่ต้องสร้าง Config.Security เพื่อเปิด Client Dispatch
ไม่ต้องสร้าง Config.Security เพิ่ม ให้ตั้งเฉพาะ Config.Dispatch.Types และค่าที่มีใน Customer Config รุ่นปัจจุบัน