Server Exports

Server Exports

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'
---@return table or nil
local 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'
---@return table or nil
local 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:


addTransaction

Register a new transaction

Explanation

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:


getMoney

Get company/gang balance


setMoney

Set the balance of the company/gang account

Explanation

Example:


addMoney

Add money to the business/gang account

Explanation

Example:


removeMoney

Remove money from the business/gang account

Explanation

Example:


getEmployees

Get information on all employees of a job

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


getGangMembers

Get information on all gang members

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


getClothings

Get information on all job/gang outfits

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)

Result:


getClothing

Get information about a specific outfit from job/gang

Explanation

After using this export, you will get the return information as a table if the provided outfit exist.

Parameters:

  • id: string

  • job: string

  • grades: table

  • name: string

  • gender: number (0 = male, 1 = female)

  • outfit: table

Result:


getPlayerBadge

Get a player's badge number from a specific job

Explanation

Example usage when you need to return a badge number in a script


getPlayerBadges

Get all player badge numbers


setPlayerBadge

Set the player a new badge number


sendAnnouncement

Send a message to the job/gang

Explanation

You can use this as a message to the jobs / gangs, example use for storyline event for gangs.

Example:

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:


getGradePermissions

Get permissions information for grade specific jobs or gangs

Explanation

Results:

Getting informations about grade permissions for which no permissions are configured:

Getting informations about grade perms for which it has permissions configured

Getting informations about grade perms, which is entered in theConfig.JobMenusSettings - maxPermissionsGrades


havePermission

Check if a certain grade of job/gang has permissions for a certain action

Explanation

Example:

Permissions List:

  • employeesAccess

    employeesGrantBonus employeesChangeGrade

    employeesFire

    employeesHire

  • clothingAccess

    clothingCreate

    clothingModify

  • safeAccess

    safeBalance

    safeWithdraw

    safeDeposit

    safeTransfer

    safeTransactions

  • stashAccess

  • announcementsAccess

  • resumesAccess

  • taxesAccess

Last updated

Was this helpful?