Draft
Conversation
Agent-Logs-Url: https://github.com/fivemanage/sdk/sessions/cd999e33-30e4-4ec2-a7fb-c2930fb6788d Co-authored-by: itschip <59088889+itschip@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add ESX economy logging integration
Add ESX economy logging integration
Apr 7, 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 a third-party logging integration for ESX economy resources, automatically capturing structured transaction logs from
esx_banking,esx_billing,esx_society,esx_vehicleshop, andesx_weaponshop.New file:
features/logs/server/third-party/esx-economy.tsonNet(), gated byconfig.logs.esxEconomyEvents?.enabledGetPlayerName()and passes_internal_RESOURCEto attribute logs to the correct ESX resourcedepositMoney,withdrawMoney,transferMoneyaddBill,payBillpay,addMoney,removeMoneybuyVehiclebuyWeapon,buyAmmoConfig & schema
config.json: addsesxEconomyEvents: { enabled: false, dataset: "default" }underlogsconfig.schema.json: adds corresponding schema entry and"esxEconomyEvents"to therequiredarrayfeatures/utils/common/config.ts: addsesxEconomyEvents: EventConfigSchematoConfigSchemaWiring
features/logs/server/logger.ts: imports./third-party/esx-economyalongside the existingox-inventoryimportExample log entry for a bank transfer:
Original prompt
Add ESX Economy Logging Integration
Add a new third-party logging integration for ESX economy resources (
esx_banking,esx_billing,esx_society,esx_vehicleshop,esx_weaponshop) that automatically sends structured logs to Fivemanage when economic transaction events fire.Background
The SDK already has a pattern for third-party integrations (see
features/logs/server/third-party/ox-inventory.ts). We need to follow the same pattern exactly: create a new file, gate it behind a config flag, and import it inlogger.ts.What to implement
1. Create
features/logs/server/third-party/esx-economy.tsListen to the following events using
onNet():esx_banking:
esx_banking:depositMoney— args:(playerId: number, amount: number)— message:player ${playerName} deposited $${amount}, metadata:{ playerSource, playerName, amount, action: "deposit" }, resource:"esx_banking"esx_banking:withdrawMoney— args:(playerId: number, amount: number)— message:player ${playerName} withdrew $${amount}, metadata:{ playerSource, playerName, amount, action: "withdraw" }, resource:"esx_banking"esx_banking:transferMoney— args:(senderId: number, targetId: number, amount: number)— message:player ${senderName} transferred $${amount} to ${targetName}, metadata:{ playerSource: senderId, playerName: senderName, targetSource: targetId, targetName, amount, action: "transfer" }, resource:"esx_banking"esx_billing:
esx_billing:addBill— args:(targetId: number, senderId: number, societyName: string, label: string, amount: number)— message:player ${targetName} billed $${amount} for "${label}" by ${senderName}, metadata:{ targetSource: targetId, targetName, playerSource: senderId, playerName: senderName, societyName, billLabel: label, amount }, resource:"esx_billing"esx_billing:payBill— args:(playerId: number, billId: number, amount: number)— message:player ${playerName} paid bill #${billId} for $${amount}, metadata:{ playerSource: playerId, playerName, billId, amount }, resource:"esx_billing"esx_society:
esx_society:pay— args:(playerId: number, societyName: string, amount: number)— message:player ${playerName} paid $${amount} from society ${societyName}, metadata:{ playerSource, playerName, societyName, amount, action: "pay" }, resource:"esx_society"esx_society:addMoney— args:(societyName: string, amount: number)— message:society ${societyName} received $${amount}, metadata:{ societyName, amount, action: "add" }, resource:"esx_society"esx_society:removeMoney— args:(societyName: string, amount: number)— message:society ${societyName} lost $${amount}, metadata:{ societyName, amount, action: "remove" }, resource:"esx_society"esx_vehicleshop:
esx_vehicleshop:buyVehicle— args:(playerId: number, model: string, price: number, type: string)— message:player ${playerName} bought vehicle ${model} for $${price}, metadata:{ playerSource, playerName, vehicleModel: model, vehicleType: type, price }, resource:"esx_vehicleshop"esx_weaponshop:
esx_weaponshop:buyWeapon— args:(playerId: number, weaponName: string, price: number)— message:player ${playerName} bought weapon ${weaponName} for $${price}, metadata:{ playerSource, playerName, weaponName, price }, resource:"esx_weaponshop"esx_weaponshop:buyAmmo— args:(playerId: number, weaponName: string, ammoCount: number, price: number)— message:player ${playerName} bought ${ammoCount}x ammo for ${weaponName}, metadata:{ playerSource, playerName, weaponName, ammoCount, price }, resource:"esx_weaponshop"All events should:
onNet(...)to listenGetPlayerName(id.toString())to resolve player names where applicable{ _internal_RESOURCE: "<resource-name>" }as the last_internalOptsargument toingest()if (config.logs.esxEconomyEvents?.enabled)config.logs.esxEconomyEvents.datasetas the dataset2. Update
config.jsonAdd inside
"logs":3. Update
config.schema.jsonAdd the schema entry for
esxEconomyEventsfollowing the exact same structure as existing entries:Also add
"esxEconomyEvents"to therequiredarray.4. Update
features/logs/server/logger.tsAdd ...
This pull request was created from Copilot chat.