Skip to content

๐Ÿ‘” qb-management

Introduction

  • Handles all the storage and society logic for jobs and gangs

Preview

Configuration

Boss menu

Config.BossMenus = { -- if target not enabled
    ['police'] = { -- job name
        vector3(461.45, -986.2, 30.73), -- location for distance checking
    },
}

Config.BossMenuZones = { -- if target is enabled
    ['police'] = { -- job name
        { -- polyzone box information
            coords = vector3(461.45, -986.2, 30.73),
            length = 0.35,
            width = 0.45,
            heading = 351.0,
            minZ = 30.58,
            maxZ = 30.68
        },
    },
}

Gang menu

Config.GangMenus = { -- if target not enabled
    ['lostmc'] = {
        vector3(0, 0, 0), -- location for distance checking
    },
}

Config.GangMenuZones = { -- if target is enabled
    ['gangname'] = { -- gang name
        { -- polyzone box information
            coords = vector3(0.0, 0.0, 0.0),
            length = 0.0,
            width = 0.0,
            heading = 0.0,
            minZ = 0.0,
            maxZ = 0.0
        },
    },
}

Server exports

AddMoney

RegisterCommand('testaddmoney, function(source)
    local Player = QBCore.Functions.GetPlayer(source)
    if not Player then return end
    local job = Player.PlayerData.job.name
    exports['qb-management']:AddMoney(job, 500) -- Add $500 to society account
end)

AddGangMoney

RegisterCommand('testaddgangmoney, function(source)
    local Player = QBCore.Functions.GetPlayer(source)
    if not Player then return end
    local gang = Player.PlayerData.gang.name
    exports['qb-management']:AddGangMoney(gang, 500) -- Add $500 to society
end)

RemoveMoney

RegisterCommand('testremovemoney, function(source)
    local Player = QBCore.Functions.GetPlayer(source)
    if not Player then return end
    local job = Player.PlayerData.job.name
    exports['qb-management']:RemoveMoney(job, 500) -- Remove $500 society account
end)

RemoveGangMoney

RegisterCommand('testremovegangmoney, function(source)
    local Player = QBCore.Functions.GetPlayer(source)
    if not Player then return end
    local gang = Player.PlayerData.gang.name
    exports['qb-management']:RemoveGangMoney(gang, 500) -- Remove $500 society
end)

GetAccount

RegisterCommand('testgetaccount, function(source)
    local Player = QBCore.Functions.GetPlayer(source)
    if not Player then return end
    local job = Player.PlayerData.job.name
    local society = exports['qb-management']:GetAccount(job)
    print(society) -- if society exists prints balance else prints 0
end)

GetGangAccount

RegisterCommand('testgetgangaccount, function(source)
    local Player = QBCore.Functions.GetPlayer(source)
    if not Player then return end
    local gang = Player.PlayerData.gang.name
    local society = exports['qb-management']:GetGangAccount(gang)
    print(society) -- if society exists prints balance else prints 0
end)