🎉 Driving School is released. Read more →
Paid Scripts
Company Manager v5
Functions & Events
Server
GetCompany

GetCompany

This function returns the company class.

exports.bcs_companymanager:GetCompany(companyname)

The Company Class

Constructor

VariableTypeDescription
namestringThe company/job name
labelstringThe company/job label
accounttableThe company account
employeetableA list of employees

The Account Class

Constructor

VariableTypeDescription
companystringThe company/job name
moneynumberThe amount of money
blackMoneynumberThe amount of black money

Functions

FunctionReturn TypeDescription
GetMoney(account)numberReturns the company money
AddEarning(amount)nilAdds earning to the company. Amount in number
AddMoney(account, amount, identifier, reason, isPaying)nilAdds money to the company. Account in string can be money or black_money. Amount in number, identifier can be player Identifier or job name
RemoveMoney(account, amount, identifier, reason, isPaying)nilRemoves money from the company. Account in string can be money or black_money. Amount in number, identifier can be player Identifier or job name

Example Usage

You can use this to add/remove money/black money.

RegisterCommand('withdrawpolice', function(source, args, raw)
    local company = exports.bcs_companymanager:GetCompany('police')
    local xPlayer = ESX.GetPlayerFromId(source)
    if company and company.account.money >= 5000 then
        company.account:RemoveMoney('money', 5000)
        xPlayer.addMoney(5000)
    end
end, true)
 
RegisterCommand('withdrawblackpolice', function(source, args, raw)
    local company = exports.bcs_companymanager:GetCompany('police')
    local xPlayer = ESX.GetPlayerFromId(source)
    if company and company.account.blackMoney >= 5000 then
        company.account:RemoveMoney('black_money', 5000)
        xPlayer.addMoney(5000)
    end
end, true)

QB Example for qb-customs.

qb-customs/server/sv_bennys.lua