Frameworks

server/custom/framework

Config.Framework = 'qb-core' -- auto/qb-core/qbox/esx/vrp/standalone
if Config.Framework ~= 'qb-core' then
    return
end

Framework = {}

local QBCore = exports['qb-core']:GetCoreObject()

function Framework.GetPlayerIdentifier(source)
   return QBCore.Functions.GetPlayer(source)?.PlayerData?.citizenid
end

function Framework.GetSourceFromIdentifier(identifier)
    return QBCore.Functions.GetPlayerByCitizenId(identifier)?.PlayerData?.source
end

function Framework.AddMoney(identifier, amount, reason)
    local source = Framework.GetSourceFromIdentifier(identifier)
    local PlayerData = QBCore.Functions.GetPlayer(source)
    PlayerData.Functions.AddMoney('bank', amount, reason)
end

function Framework.RegisterCommand(name, description, callback, group)
    QBCore.Commands.Add(name, description, {}, false, callback, group)
end

client/custom/framework

Last updated

Was this helpful?