Create Offline Bill Event
This functionality allows you to create bills for players or companies that may not be currently online.
Parameters
---@param targetIdentifier string The target's identifier/citizen ID or company/job name
---@param targetName string The full name of the target
---@param amount number The invoice amount
---@param description string The invoice reason/description
---@param from {label: string, job: string, identifier: string} Source information
---@param src? number Optional - Source ID when triggering from server side
Server-Side Implementation
Use this method to create a bill directly from server-side code:
local from = {
label = 'Police',
job = 'police',
identifier = 'police',
}
exports['bcs_companymanager']:CreateOfflineBill(source, targetIdentifier, targetName, 5000, 'Fine for speeding', from)
Client-Side Implementation
Use this event to create a bill from client-side code:
TriggerServerEvent('CompanyManager:server:CreateOfflineBill', targetIdentifier, targetName, 5000, 'Fine for speeding')
Sending Bills to Companies
You can also send bills to other companies. The target company must exist in your Config.billing
configuration:
-- Example: Police department sending a bill to the ambulance department
TriggerServerEvent('CompanyManager:server:CreateOfflineBill', 'ambulance', 'Ambulance Department', 5000, 'Emergency assistance')
Note: When billing another company, ensure the target company name ('ambulance'
in the example) is properly configured in your Config.billing
settings.
Last updated on