Exports ด้านล่างเป็น Integration Boundary สำหรับ resource ภายนอก ควรเรียกจากฝั่ง Client/Server ให้ตรงกับประเภท Export
Dispatch#
Client: ReportCrime#
lua
exports['nX_police']:ReportCrime('cement', {
category = 'normal',
details = 'พบการขโมยวัสดุก่อสร้าง'
})Server: ReportCrime#
lua
exports['nX_police']:ReportCrime('cement', {
source = playerId,
category = 'normal',
details = 'พบการขโมยวัสดุก่อสร้าง'
})DispatchCrime เป็น alias ของ ReportCrime
Search / Seizure#
| Export | Side | ใช้ทำอะไร |
|---|---|---|
CanSearchType | Server | ตรวจว่าเจ้าหน้าที่มีสิทธิ์ใช้ประเภทการค้นหรือไม่ |
CanSearchTarget | Server | ตรวจ permission / target ก่อนค้น |
ShouldRouteSearchSeizure | Server | ถามว่าการยึดครั้งนี้ควรส่งเข้าตู้หน่วยงานหรือไม่ |
DepositSearchSeizure | Server | ฝากของจาก Search hook เข้าตู้หน่วยงาน |
RecordSeizedEvidence | Server | บันทึกของกลางเพื่อ Auto Charge |
Discord Log#
lua
exports['nX_police']:DiscordLog({
event = 'police_report',
source = source,
title = 'Custom server log',
description = 'รายละเอียด'
})
local stats = exports['nX_police']:DiscordLogStats()Door Lock#
lua
local state = exports['nX_police']:GetDoorState(doorId)Jail#
lua
exports['nX_police']:CutJailGps(sourceId)Notification#
| Export | Side | ใช้ทำอะไร |
|---|---|---|
Notify | Client | แสดง Toast ผ่าน Notification Provider ของ nX Police |
NotifyPlayer | Server | ส่ง Toast ไปยัง Player Source ผ่าน pipeline เดียวกัน |
lua
-- Client
exports['nX_police']:Notify('บันทึกสำเร็จ', 'success', 4500)
-- Server
exports['nX_police']:NotifyPlayer(source, 'ข้อความ', 'info', 4500)ชนิดมาตรฐานคือ info / success / error / warning และจะใช้ Config.Notification.External.TypeMap อัตโนมัติเมื่อ Provider เป็น external
UI Coordination#
| Export | Side | ใช้ทำอะไร |
|---|---|---|
SetExternalHotbarVisible | Client | แจ้ง nX Police ว่า External Hotbar กำลังแสดงอยู่ |
SetToastReservedZone | Client | จองพื้นที่หน้าจอไม่ให้ Toast ทับ UI อื่น |
PulseToastReservedZone | Client | ต่ออายุ Reserved Zone แบบ TTL |