Player
Framework-agnostic player bridge supporting ESX, QBCore and QBX
Overview
The Player bridge wraps the three most common FiveM frameworks — ESX, QBCore, and QBX — behind a single, unified interface. The correct core is resolved automatically at runtime based on which resource is started.
Access a player object via the getPlayerFromId export.
Supported Frameworks
| Framework | Resource name |
|---|---|
| ESX | es_extended |
| QBCore | qb-core |
| QBX | qbx_core |
Player Class
Functions
getPlayerFromId
Returns a Player instance for the given server ID. Instances are cached per session.
playerId:number- Returns:
Player
Player:getJob
Returns the player's current job table from the active framework.
- Returns:
table
Player:getAccounts
Returns the player's account balances from the active framework.
- Returns:
table
Player:removeItem
Removes amount of item from the player's ox_inventory.
item:stringamount:number- Returns:
boolean
Player:getItemAmount
Returns how many of item the player currently has.
item:string- Returns:
number
Player:addItem
Adds amount of item to the player's ox_inventory.
item:stringamount:number- Returns:
boolean
Player:removeAccountMoney
Deducts amount from the named account via the active framework.
account:string— e.g."bank","cash"amount:number- Returns:
boolean
Player:addAccountMoney
Credits amount to the named account via the active framework.
account:stringamount:number- Returns:
boolean
Player:removeMoney
Removes cash from the player via the active framework.
amount:number- Returns:
boolean
Player:addMoney
Adds cash to the player via the active framework.
amount:number- Returns:
boolean
Player:getGroup
Returns the player's permission group / admin level.
- Returns:
string