Draft
Conversation
Agent-Logs-Url: https://github.com/fivemanage/sdk/sessions/6aab40c2-12dd-4489-a75c-41c53173e1a5 Co-authored-by: itschip <59088889+itschip@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add third-party logging integration for qbx_police
feat: add qbx_police event logging integration
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds passive server-side event interception for
qbx_police, logging police job actions through the SDK'singest()pipeline — no changes to qbx_police required.New file:
features/logs/server/third-party/qbx-police.tsGated behind
config.logs.qbxPoliceEvents.enabled. Intercepts 9onNetevents:police:server:SetHandcuffStatusqbx_police.player.handcuffed/.unhandcuffedpolice:server:JailPlayerqbx_police.player.jailedpolice:server:BillPlayerqbx_police.player.billedpolice:server:SeizeCashqbx_police.player.cashSeizedpolice:server:Impoundqbx_police.vehicle.impounded/.sentToDepotpolice:server:Radarqbx_police.player.radarFinedpolice:server:policeAlertqbx_police.alert.dispatchedpolice:server:FlaggedPlateTriggeredqbx_police.vehicle.flaggedPlateDetectedpolice:server:SetTrackerqbx_police.player.trackerUpdatedAll handlers capture
global.sourceand include resolvedGetPlayerName()values alongside full event-specific metadata for dashboard filtering.Config changes
config.json: addedqbxPoliceEvents: { enabled: false, dataset: "default" }config.schema.json: addedqbxPoliceEventstoproperties.logs.propertiesandrequiredconfig.ts: addedqbxPoliceEvents: EventConfigSchemato the valibot schemalogger.ts: addedimport './third-party/qbx-police'Original prompt
Overview
Add a new third-party logging integration for
qbx_police— the Qbox police job resource. This follows the exact same pattern asfeatures/logs/server/third-party/ox-inventory.ts.Files to create/modify
1. Create
features/logs/server/third-party/qbx-police.tsIntercepts server-side
RegisterNetEventandAddEventHandlerevents fromqbx_policeand logs them through the SDK'singest()function.Rules:
config.logs.qbxPoliceEvents.enabledconfig.logs.qbxPoliceEvents.dataset_internal_RESOURCE: "qbx_police"in_internalOpts"qbx_police.player.handcuffed") — simple and searchableglobal.sourceto capture source inside handlersingestfrom"../logger"andconfigfrom"~/utils/common/config"Events to intercept (all via
onNetsince they are RegisterNetEvent in qbx_police):police:server:SetHandcuffStatus— handler receives(isHandcuffed: boolean)isHandcuffed ? "qbx_police.player.handcuffed" : "qbx_police.player.unhandcuffed"{ playerSource, playerName: GetPlayerName(source), isHandcuffed }police:server:JailPlayer— handler receives(targetSrc: number, time: number)"qbx_police.player.jailed"{ playerSource (officer), playerName: GetPlayerName(source), targetSource: targetSrc, targetName: GetPlayerName(targetSrc.toString()), jailTimeMinutes: time }police:server:BillPlayer— handler receives(targetSrc: number, price: number)"qbx_police.player.billed"{ playerSource (officer), playerName: GetPlayerName(source), targetSource: targetSrc, targetName: GetPlayerName(targetSrc.toString()), amount: price }police:server:SeizeCash— handler receives(targetSrc: number)"qbx_police.player.cashSeized"{ playerSource (officer), playerName: GetPlayerName(source), targetSource: targetSrc, targetName: GetPlayerName(targetSrc.toString()) }police:server:Impound— handler receives(plate: string, fullImpound: boolean, price: number, body: number, engine: number, fuel: number)fullImpound ? "qbx_police.vehicle.impounded" : "qbx_police.vehicle.sentToDepot"{ playerSource, playerName: GetPlayerName(source), plate, fullImpound, price: price ?? 0, bodyDamage: body, engineDamage: engine, fuelLevel: fuel }police:server:Radar— handler receives(fine: number)"qbx_police.player.radarFined"{ playerSource, playerName: GetPlayerName(source), fineIndex: fine }police:server:policeAlert— handler receives(text: string, camId: number | undefined, playerSource: number | undefined)"qbx_police.alert.dispatched"{ playerSource: playerSource ?? source, text, camId: camId ?? null }police:server:FlaggedPlateTriggered— handler receives(radar: string, plate: string, street: string)"qbx_police.vehicle.flaggedPlateDetected"{ playerSource: source, playerName: GetPlayerName(source.toString()), plate, street, radar }police:server:SetTracker— handler receives(targetId: number)"qbx_police.player.trackerUpdated"{ playerSource (officer), playerName: GetPlayerName(source), targetSource: targetId, targetName: GetPlayerName(targetId.toString()) }2. Modify
features/logs/server/logger.tsAdd the import after the existing third-party imports:
3. Modify
config.jsonAdd inside
"logs":4. Modify
config.schema.jsonAdd schema entry for
qbxPoliceEventsfollowing the same pattern asoxInventoryEvents. Add it toproperties.logs.propertiesand to therequiredarray inproperties.logs.Notes
onNet(eventName, cb)is the TypeScript equivalent ofRegisterNetEventLua handlerson(eventName, cb)is for server-onlyAddEventHandlerGetPlayerNamecalls should pass a string — use.toString()where neededox-inventory.tsThe following is the prior conversation context from the use...
This pull request was created from Copilot chat.