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: booleanGetPlayerIdentifier
Returns the player’s identifier.
local id = Bridge.Framework.GetPlayerIdentifier()
-- Returns: stringGetPlayerName
Returns the player’s character name.
local name = Bridge.Framework.GetPlayerName()
-- Returns: stringGetPlayerJobData
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: stringGetPlayerMetaData
Returns the player’s metadata for a given key.
local meta = Bridge.Framework.GetPlayerMetaData(key)| Parameter | Type | Description |
|---|---|---|
| key | string | Metadata key to retrieve |
GetHunger
Returns the player’s hunger level.
local hunger = Bridge.Framework.GetHunger()
-- Returns: numberGetThirst
Returns the player’s thirst level.
local thirst = Bridge.Framework.GetThirst()
-- Returns: numberHasItem
Warning: This is an internal fallback. Use
Bridge.Inventory.HasItemfor item checks.
Checks if the player has a specific item.
local has = Bridge.Framework.HasItem(item, amount)
-- Returns: boolean| Parameter | Type | Description |
|---|---|---|
| item | string | Item name |
| amount | number | Minimum amount (optional, default 1) |
GetItemCount
Warning: This is an internal fallback. Use
Bridge.Inventory.GetItemCountfor item counts.
Returns the count of a specific item in the player’s inventory.
local count = Bridge.Framework.GetItemCount(item)
-- Returns: number| Parameter | Type | Description |
|---|---|---|
| item | string | Item name |
GetPlayerInventory
Warning: This is an internal fallback. Use
Bridge.Inventory.GetPlayerInventoryto access inventory data.
Returns the player’s full inventory table.
local inventory = Bridge.Framework.GetPlayerInventory()
-- Returns: tableGetAccountBalance
Returns the player’s balance for a given account type.
local balance = Bridge.Framework.GetAccountBalance(accountType)
-- Returns: number| Parameter | Type | Description |
|---|---|---|
| accountType | string | Account type (e.g. ‘cash’, ‘bank’) |
GetIsPlayerDead
Returns whether the player is dead.
local dead = Bridge.Framework.GetIsPlayerDead()
-- Returns: booleanGetVehicleProperties
Returns all properties of a vehicle entity.
local props = Bridge.Framework.GetVehicleProperties(vehicle)
-- Returns: table| Parameter | Type | Description |
|---|---|---|
| vehicle | number | Vehicle entity handle |
SetVehicleProperties
Applies a properties table to a vehicle entity.
Bridge.Framework.SetVehicleProperties(vehicle, props)| Parameter | Type | Description |
|---|---|---|
| vehicle | number | Vehicle entity handle |
| props | table | Properties table (from GetVehicleProperties) |
GetJobCount
Returns the count of online players with a specific job.
local count = Bridge.Framework.GetJobCount(job)
-- Returns: number| Parameter | Type | Description |
|---|---|---|
| job | string | Job name |
GetJobCountTotal
Returns the count of online players across multiple jobs.
local count = Bridge.Framework.GetJobCountTotal(jobs)
-- Returns: number| Parameter | Type | Description |
|---|---|---|
| jobs | table | Array 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
GetPlayerJobDatainstead. Returns only the job name string.
local jobName = Bridge.Framework.GetPlayerJob()