Server Exports
REMEMBER ABOUT CLIENT SIDE AND SERVER SIDE IN CHOOSING EXPORT!
createInvoice
Use following export to create invoice for company
local societyName = 'society_police' -- must be name from doj_companies in database
local employee = 'John Doe'
local customer = 'Jane Smith'
local title = 'Mechanic Service'
local price = 1000
exports['p_dojmdt']:createInvoice(societyName, employee, customer, title, price)
getEmployeeLicenses
Use following export to get employee current licenses
local identifier = 'char1:123456' -- replace with existing player identifier
local licenses = exports['p_dojmdt']:getEmployeeLicenses(identifier)
print(licenses['lawyer']) -- index license name from config.employees
Return:
licenses:
{[key: string]: boolean | nil}
getMoney
Use following export to check balance of society doj account
local jobName = 'doj'
local money = exports['p_dojmdt']:getMoney(jobName)
print(money)
Return:
money:
number
addMoney
Use following export to add money into society doj account
local data = {from = 'John Doe', amount = 10, jobName = 'doj', jobLabel = 'DOJ'}
local success = exports['p_dojmdt']:addMoney(data)
print(success)
Return:
success:
boolean
removeMoney
Use following export to remove money from society doj account
local data = {to = 'John Doe', amount = 10, jobName = 'doj', jobLabel = 'DOJ'}
local success = exports['p_dojmdt']:removeMoney(data)
print(success)
Return:
success:
boolean
payTax
Use following export to pay tax [It will add money to doj society account and return amount without tax]
local taxType = 'income' -- tax type from config.taxes
local bruttoAmount = 1000
local success = exports['p_dojmdt']:payTax(taxType, bruttoAmount)
if success then
-- remove player money
end
Last updated