Framework — Client

Functions

GetResourceName

Returns the framework resource name.

local name = Bridge.Framework.GetResourceName()
-- Returns: string (e.g. 'es_extended', 'qb-core', 'qbx_core')

GetIsPlayerLoaded

Returns whether the player has fully loaded into the framework.

local loaded = Bridge.Framework.GetIsPlayerLoaded()
-- Returns: boolean

GetPlayerIdentifier

Returns the player’s identifier.

local id = Bridge.Framework.GetPlayerIdentifier()
-- Returns: string

GetPlayerName

Returns the player’s character name.

local name = Bridge.Framework.GetPlayerName()
-- Returns: string

GetPlayerJobData

Returns the player’s job data table.

local job = Bridge.Framework.GetPlayerJobData()
-- Returns: table { name: string, label: string, grade: number, gradeLabel: string, isBoss: boolean, duty: boolean, type: string }

GetPlayerDob

Returns the player’s date of birth.

local dob = Bridge.Framework.GetPlayerDob()
-- Returns: string

GetPlayerMetaData

Returns the player’s metadata for a given key.

local meta = Bridge.Framework.GetPlayerMetaData(key)
ParameterTypeDescription
keystringMetadata key to retrieve

GetHunger

Returns the player’s hunger level.

local hunger = Bridge.Framework.GetHunger()
-- Returns: number

GetThirst

Returns the player’s thirst level.

local thirst = Bridge.Framework.GetThirst()
-- Returns: number

HasItem

Warning: This is an internal fallback. Use Bridge.Inventory.HasItem for item checks.

Checks if the player has a specific item.

local has = Bridge.Framework.HasItem(item, amount)
-- Returns: boolean
ParameterTypeDescription
itemstringItem name
amountnumberMinimum amount (optional, default 1)

GetItemCount

Warning: This is an internal fallback. Use Bridge.Inventory.GetItemCount for item counts.

Returns the count of a specific item in the player’s inventory.

local count = Bridge.Framework.GetItemCount(item)
-- Returns: number
ParameterTypeDescription
itemstringItem name

GetPlayerInventory

Warning: This is an internal fallback. Use Bridge.Inventory.GetPlayerInventory to access inventory data.

Returns the player’s full inventory table.

local inventory = Bridge.Framework.GetPlayerInventory()
-- Returns: table

GetAccountBalance

Returns the player’s balance for a given account type.

local balance = Bridge.Framework.GetAccountBalance(accountType)
-- Returns: number
ParameterTypeDescription
accountTypestringAccount type (e.g. ‘cash’, ‘bank’)

GetIsPlayerDead

Returns whether the player is dead.

local dead = Bridge.Framework.GetIsPlayerDead()
-- Returns: boolean

GetVehicleProperties

Returns all properties of a vehicle entity.

local props = Bridge.Framework.GetVehicleProperties(vehicle)
-- Returns: table
ParameterTypeDescription
vehiclenumberVehicle entity handle

SetVehicleProperties

Applies a properties table to a vehicle entity.

Bridge.Framework.SetVehicleProperties(vehicle, props)
ParameterTypeDescription
vehiclenumberVehicle entity handle
propstableProperties table (from GetVehicleProperties)

GetJobCount

Returns the count of online players with a specific job.

local count = Bridge.Framework.GetJobCount(job)
-- Returns: number
ParameterTypeDescription
jobstringJob name

GetJobCountTotal

Returns the count of online players across multiple jobs.

local count = Bridge.Framework.GetJobCountTotal(jobs)
-- Returns: number
ParameterTypeDescription
jobstableArray of job name strings

Events

community_bridge:Client:OnPlayerLoaded

Fired when the player finishes loading into the framework.

RegisterNetEvent('community_bridge:Client:OnPlayerLoaded', function()
    -- Player is now loaded
end)

community_bridge:Client:OnPlayerUnload

Fired when the player unloads (e.g. character switch, disconnect).

RegisterNetEvent('community_bridge:Client:OnPlayerUnload', function()
    -- Cleanup here
end)

community_bridge:Client:OnPlayerJobUpdate

Fired when the player’s job changes.

RegisterNetEvent('community_bridge:Client:OnPlayerJobUpdate', function(jobData)
    -- jobData: table { name, label, grade, gradeLabel, isBoss, duty, type }
end)

Deprecated

GetPlayerJob

Use GetPlayerJobData instead. Returns only the job name string.

local jobName = Bridge.Framework.GetPlayerJob()