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

GetAccount

This function returns the company account class.

exports.bcs_companymanager:GetAccount(companyname)

The Account Class

Constructor

VariableTypeDescription
companystringThe company/job name
moneynumberThe total money of the company
blackMoneynumberThe total dirty money of the company
earningnumberThe total earning of the company

Functions

FunctionReturn TypeDescription
getMoney()numberReturns the company money
addEarning(amount)nilAdds earning to the company. Amount in number
addMoney(account, amount)nilAdds money to the company. Account in string can be money or black_money. Amount in number
removeMoney(account, amount)nilRemoves money from the company. Account in string can be money or black_money. Amount in number

Example Usage

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

RegisterCommand('withdrawpolice', function(source, args, raw)
    local companyAccount = exports['bcs_companymanager']:GetAccount('police')
    local xPlayer = ESX.GetPlayerFromId(source)
    if companyAccount.money >= 5000 then
        companyAccount.removeMoney('money', 5000)
        xPlayer.addMoney(5000)
    end
end, true)
 
RegisterCommand('withdrawblackpolice', function(source, args, raw)
    local companyAccount = exports['bcs_companymanager']:GetAccount('police')
    local xPlayer = ESX.GetPlayerFromId(source)
    if companyAccount.blackMoney >= 5000 then
        companyAccount.removeMoney('black_money', 5000)
        xPlayer.addMoney(5000)
    end
end, true)

QB Example for qb-customs.

qb-customs/server/sv_bennys.lua