Below are all the useful exports that you can use in other resources, be sure to read their descriptions.
getSociety
Get all the information about the registered company/gang
---@param {jobName: string}: Registered job or gang name, e.g. 'police' / 'ballas'---@returntable or nillocal society = exports['vms_bossmenu']:getSociety(jobName)
Explanation
If you use the above export, you will get the return information in the table if the job/gang is registered in the config, if not, you will get the return as nil.
Parameters:
type: string
balance: number
accountName: string
data: table
announcements: table
getSocietyTransactions
Get a list of all transactions from the company
---@param {jobName: string}: Registered job or gang name, e.g. 'police' / 'ballas'---@returntable or nillocal societyTransactions = exports['vms_bossmenu']:getSocietyTransactions(jobName)
Explanation
If you use the above export, you will get the return information in the table if the job/gang is registered in the config, if not, you will get the return as nil.
Result:
{
{
id = 192,
name = 'police',
executor = 'Character Name',
executor_identifier = 'char1:XXXXXXXXXXXX',
type = 'withdraw',
amount = 5000,
title = '',
date = 1732069344,
},
{
id = 242,
name = 'police',
executor = 'Character Name',
executor_identifier = 'char1:XXXXXXXXXXXX',
type = 'transfer_outgoing',
amount = 5000,
title = 'Test Transfer to EMS',
date = 1732069486,
},
}
This export is for entering transactions into the registry, but it will not perform the flow of funds, it will only register the transaction in the database for the job / gang.
Example:
local src = 1 -- player id
local jobNameFrom = 'police' -- from whom the transaction is going out
local jobNameTo = 'ambulance' -- to whom the transaction comes (if there is a jobNameTo parameter other than nil in the transaction, then it will automatically add a transaction for the receiving transaction as well)
local type = 'transfer_outgoing'
local amount = 50000
local title = 'Money transfer to EMS'
exports['vms_bossmenu']:addTransaction(src, jobNameFrom, jobNameTo, type, amount, title, function(success)
print(success)
-- Here you can continue your function when a transaction is registered
-- For example, here you can take money away from the company or add it
-- exports['vms_bossmenu']:removeMoney(jobNameFrom, amount)
-- exports['vms_bossmenu']:addMoney(jobNameTo, amount)
end)
getMoney
Get company/gang balance
---@param {jobName: string}: Registered job or gang name, e.g. 'police' / 'ballas'
---@return number
local money = exports['vms_bossmenu']:getMoney(jobName)
setMoney
Set the balance of the company/gang account
---@param {jobName: string}: Registered job or gang name, e.g. 'police' / 'ballas'
---@param {amount: number}
---@param {cb: function | nil}
exports['vms_bossmenu']:setMoney(jobName, amount, cb)
Explanation
Example:
local jobName = 'police'
local amount = 3000
exports['vms_bossmenu']:setMoney(jobName, amount, function(success, totalBalance)
print(success)
print('Total balance after setting the amount', totalBalance)
end)
addMoney
Add money to the business/gang account
---@param {jobName: string}: Registered job or gang name, e.g. 'police' / 'ballas'
---@param {amount: number}
---@param {cb: function | nil}
exports['vms_bossmenu']:addMoney(jobName, amount, cb)
Explanation
Example:
local jobName = 'police'
local amount = 10000
exports['vms_bossmenu']:addMoney(jobName, amount, function(success, totalBalance)
print(success)
print('Total balance after adding the amount', totalBalance)
end)
removeMoney
Remove money from the business/gang account
---@param {jobName: string}: Registered job or gang name, e.g. 'police' / 'ballas'
---@param {amount: number}
---@param {cb: function | nil}
exports['vms_bossmenu']:removeMoney(jobName, amount, cb)
Explanation
Example:
local jobName = 'police'
local amount = 15000
exports['vms_bossmenu']:removeMoney(jobName, amount, function(success, totalBalance)
print(success)
print('Total balance after removing the amount', totalBalance)
end)
getEmployees
Get information on all employees of a job
---@param {jobName: string}: Registered job name, e.g. 'police' / 'ambulance'
---@return table
local employees = exports['vms_bossmenu']:getEmployees(jobName)
Explanation
After using this export, you will get the return information as a table if the job/gang is registered in the config, if not, you will get nil.
Parameters:
isOnline: boolean
name: string
identifier: string
job: table
name: string
label: string
grade: number
grade_name: string
getEmployeesCount
Get the number of employees of a given job
---@param {jobName: string}: Registered job name, e.g. 'police' / 'ambulance'
local employeesCount = exports['vms_bossmenu']:getEmployeesCount(jobName)
getGangMembers
Get information on all gang members
---@param {gangName: string}: Registered gang name, e.g. 'vagos' / 'ballas'
---@return table
local members = exports['vms_bossmenu']:getGangMembers(gangName)
Explanation
After using this export, you will get the return information as a table if the job/gang is registered in the config, if not, you will get nil.
Parameters:
isOnline: boolean
name: string
identifier: string
job: table
name: string
label: string
grade: number
grade_name: string
getGangMembersCount
Get the number of gang members
---@param {gangName: string}: Registered gang name, e.g. 'vagos' / 'ballas'
---@return number
local membersCount = exports['vms_bossmenu']:getGangMembersCount(gangName)
getClothings
Get information on all job/gang outfits
---@param {jobName: string}: Registered job or gang name, e.g. 'police' / 'ballas'
---@param {withOutfit: boolean}
---@return table
local clothingList = exports['vms_bossmenu']:getClothings(jobName, withOutfit)
Explanation
After using this export, you will get the return information as a table with all available outfits.
Parameters:
id: string
job: string
grades: table
name: string
gender: number (0 = male, 1 = female)
outfit: table or nil (depending on whether prarameter withOutfit will be as true or false)
---@param {identifier: number | string}: Player ID or Player Identifier
---@param {jobName: string}: Job name, e.g. 'police'
exports['vms_bossmenu']:getPlayerBadge(identifier, jobName, function(badge)
print('Badge ID:', badge)
end)
Explanation
Example usage when you need to return a badge number in a script
local badgeNumber = nil
local response = false
exports['vms_bossmenu']:getPlayerBadge(src, xPlayer.job.name, function(badge)
badgeNumber = badge
response = true
end)
while not response do
Citizen.Wait(200)
end
return badgeNumber or 'NONE'
getPlayerBadges
Get all player badge numbers
---@param {identifier: number | string}: Player ID or Player Identifier
---@return table
local badges = exports['vms_bossmenu']:getPlayerBadges(identifier)
setPlayerBadge
Set the player a new badge number
---@param {identifier: number | string}: Player ID or Player Identifier
---@param {jobName: string}: Job name, e.g. 'police'
---@param {badgeNumber: number}
exports['vms_bossmenu']:setPlayerBadge(identifier, jobName, badgeNumber)
sendAnnouncement
Send a message to the job/gang
---@param {jobName: string}: Registered job or gang name, e.g. 'police' / 'ballas'
---@param {text: string}: Message
---@param {type: string}: Name of the sender, configurable in config.translation.lua
exports['vms_bossmenu']:sendAnnouncement(jobName, text, type)
Explanation
You can use this as a message to the jobs / gangs, example use for storyline event for gangs.
Example:
local jobName = 'ballas'
local text = 'I heard that tomorrow (24.11.2024) in the evening 18:00 - 20:00, there will be a transport of police weapons from the warehouse on Mission Row to the warehouse on Paleto Bay, get information about the route of the convoy and steal as much loot for us, you will receive a decent salary, good luck!'
local type = 'mafia'
exports['vms_bossmenu']:sendAnnouncement(jobName, text, type)
New type of announcement
By default there is no mafia message type in the script, there is only cityhall, so if you want to use a custom one, you need to register a translation, for this purpose go to config.translation.lua, find announcement.cityhall in your language and add a new one underneath for example:
['announcement.mafia'] = "Mafia",
getGradePermissions
Get permissions information for grade specific jobs or gangs
---@param {jobName: string}: Registered job or gang name, e.g. 'police' / 'ballas'
---@param {grade: number}: Grade ID
---@param {getValues: boolean}:
---@return boolean, table | string
local access, perms = exports['vms_bossmenu']:getGradePermissions(jobName, grade, getValues)
Explanation
Results:
Getting informations about grade permissions for which no permissions are configured:
local jobName = 'police'
local grade = 0 -- (Lowest grade - Recruit)
local getValues = false
local access, perms = exports['vms_bossmenu']:getGradePermissions(jobName, grade, getValues)
print(access)
-- print result: true or false
prints(perms)
-- perms will be always nil, because you set getValues = false
Getting informations about grade perms for which it has permissions configured
local jobName = 'police'
local grade = 1
local getValues = true
local access, perms = exports['vms_bossmenu']:getGradePermissions(jobName, grade, getValues)
print(access)
-- print result: true or false
print(json.decode(perms))
-- example print result: {"employeesAccess":true,"safeDeposit":true,"clothingAccess":true,"safeAccess":true}
Getting informations about grade perms, which is entered in theConfig.JobMenusSettings - maxPermissionsGrades
local jobName = 'police'
local grade = 4 -- entered in maxPermissionsGrades
local getValues = true
local access, perms = exports['vms_bossmenu']:getGradePermissions(jobName, grade, getValues)
print(access)
-- print result: true or false
print(perms)
-- print result: "max"
-- returns the value "max" if the grade is in maxPermissionsGrades.
havePermission
Check if a certain grade of job/gang has permissions for a certain action
---@param {jobName: string}: Registered job or gang name, e.g. 'police' / 'ballas'
---@param {grade: number}: Grade ID
---@param {action: string}: permission name (List of permissions in #Explanation)
---@return boolean
local access = exports['vms_bossmenu']:havePermission(jobName, grade, action)
Explanation
Example:
local jobName = 'police'
local grade = 3
local action = 'safeTransfer'
local access = exports['vms_bossmenu']:havePermission(jobName, grade, action)
print(access)
-- print result: true or false