เพิ่มประเภทเหตุ#
แก้ที่ Config.Dispatch.Types ใน config/customer/02_dispatch.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 iconWorldBoundary— เปิด/ปิดและปรับสี/ความสูง/ความโปร่งใสของขอบเขตในโลกเกม
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 เพิ่ม
exports['nX_police']:ReportCrime('cement', {
category = 'normal',
details = 'พบการขโมยวัสดุก่อสร้าง'
})Server-side ReportCrime#
exports['nX_police']:ReportCrime('cement', {
source = playerId,
category = 'normal',
details = 'พบการขโมยวัสดุก่อสร้าง'
})หากไม่มี Player Source สามารถส่ง coords = { x = ..., y = ..., z = ... } แทนได้
ข้อมูลที่ Client เติมให้อัตโนมัติ#
เมื่อเรียก ReportCrime จาก Client หากไม่ได้ส่งข้อมูลบริบท ระบบสามารถเติม coords, street, zone และ gender ที่รองรับให้อัตโนมัติ; ค่าที่ส่งมาเองจะถูกใช้แทน
coords ตามตัวอย่าง Server-sideสีตามหมวดคดี#
category อ้างอิง Config.ChargeCategories[].code ใน config/data/charges.lua และใช้สีที่ตั้งไว้ในหมวดนั้น
สีหมวดรองรับ #RRGGBB, linear-gradient(...) และ radial-gradient(...) โดยตั้งไว้ที่ข้อมูลหมวดคดีฝั่ง Server/Config เช่น:
color = '#4D8DF7'
-- หรือ
color = 'linear-gradient(to right, #007aff, #5e70e3)'
-- หรือ
color = 'radial-gradient(circle at center, #007aff 0%, #101827 100%)'Config.Security เพิ่ม ให้ตั้งเฉพาะ Config.Dispatch.Types และค่าที่มีใน Customer Config รุ่นปัจจุบัน