Framework (client)

Local player helpers. Identity, jobs, money, metadata, commands, and item use live on server. Shared types: Framework.

getStress()

Signature: getStress(): number

| Returns | number — local player stress level |

local stress = bridge.framework.getStress()

getHunger()

Signature: getHunger(): number

| Returns | number — local player hunger |

local hunger = bridge.framework.getHunger()

getThirst()

Signature: getThirst(): number

| Returns | number — local player thirst |

local thirst = bridge.framework.getThirst()

setStatus(statusType, value)

Signature: setStatus(statusType: string, value: number): void

ParamTypeDescription
statusTypestring'stress', 'hunger', or 'thirst'
valuenumberNew status value
bridge.framework.setStatus('stress', 0)

isOnDuty()

Signature: isOnDuty(): boolean

| Returns | boolean — whether the local player is on duty |

if bridge.framework.isOnDuty() then end

hasJob(job, grade?, duty?)

Signature: hasJob(job: string, grade?: number, duty?: boolean): boolean

ParamTypeDescription
jobstringJob name
gradenumber?Minimum grade
dutyboolean?Require on-duty

| Returns | boolean |

if bridge.framework.hasJob('police', 2, true) then
    bridge.notifications.notify({ description = 'On duty as Sergeant', type = 'inform' })
end

getPlayerJobData()

Signature: getPlayerJobData(): PlayerJobData?

| Returns | PlayerJobData? |

local job = bridge.framework.getPlayerJobData()
if job then print(job.jobName, job.grade) end

getPlayerData()

Signature: getPlayerData(): table?

| Returns | table? — live framework player data |

local data = bridge.framework.getPlayerData()

getPlayerMetadata(key)

Signature: getPlayerMetadata(key: string): any

ParamTypeDescription
keystringMetadata key (e.g. 'stress', 'hunger')

| Returns | any |

local licenses = bridge.framework.getPlayerMetadata('licenses')

hasGroup(group, grade?, duty?)

Signature: hasGroup(group: string, grade?: number, duty?: boolean): boolean

Job or gang group from the client cache. Same grade/duty rules as hasJob.

if bridge.framework.hasGroup('ballas', 1) then end

getGroups()

Signature: getGroups(): table<string, number>?

| Returns | table<string, number>? — cached job/gang name → grade |

local groups = bridge.framework.getGroups()

getPlayerBucket()

Signature: getPlayerBucket(): number

| Returns | number — local routing bucket (LocalPlayer.state.bucket, default 0) |

local bucket = bridge.framework.getPlayerBucket()

getFrameworkJobs()

Signature: getFrameworkJobs(): table

| Returns | table — all jobs registered in the framework |

local jobs = bridge.framework.getFrameworkJobs()

getIdentifier()

Signature: getIdentifier(): string?

| Returns | string? — character identifier (citizenid / identifier) |

local id = bridge.framework.getIdentifier()

getCharacterName()

Signature: getCharacterName(): string?, string?, string?

| Returns | string?, string?, string? — full name, first name, last name |

local full, first, last = bridge.framework.getCharacterName()

getIsPlayerLoaded()

Signature: getIsPlayerLoaded(): boolean

| Returns | boolean |

if bridge.framework.getIsPlayerLoaded() then end

getAccountBalance(moneyType)

Signature: getAccountBalance(moneyType: MoneyType): number

ParamTypeDescription
moneyTypeMoneyTypeAccount type (QBX also accepts 'money')

| Returns | number |

Client balance is not authoritative. Use server getMoney for payouts or security checks.

local cash = bridge.framework.getAccountBalance('cash')

isPlayerDead()

Signature: isPlayerDead(): boolean

| Returns | boolean — dead or in last stand |

if bridge.framework.isPlayerDead() then return end

getPlayerDob()

Signature: getPlayerDob(): string?

| Returns | string? — date of birth |

local dob = bridge.framework.getPlayerDob()