Server

The ak47_bridge automatically detects the running framework. You can access these functions by importing the bridge export in your script.

local Bridge = exports['ak47_bridge']:GetBridge()

Core Player & Identity

These functions handle identifying players and retrieving their basic information across all frameworks.

Bridge.GetPlayer

Retrieves the raw framework-specific player object (e.g., xPlayer for ESX, Player for QBCore).

--- @param source number The player's server ID
--- @return table|nil The player object
local player = Bridge.GetPlayer(source)

Bridge.GetIdentifier

Returns the unique identifier for the player (CitizenID for QBCore/QBX, Identifier for ESX).

--- @param source number The player's server ID
--- @return string The unique identifier
local identifier = Bridge.GetIdentifier(source)

Bridge.GetName

Returns the player's full character name.

--- @param source number The player's server ID
--- @return string The full name (Firstname Lastname)
local name = Bridge.GetName(source)

Bridge.GetPhoneNumber

Returns the player's phone number.

Bridge.GetLicense

Returns the Rockstar license of the player.

Bridge.GetSourceFromIdentifier

Finds a player's server ID based on their identifier.

Bridge.GetPlayerMetaValue / Bridge.SetPlayerMetaValue

Gets or sets metadata for a player. (Bridges QBCore metadata and ESX xPlayer.getMeta/setMeta).


Jobs, Gangs & Permissions

Bridge.GetJob

Returns a standardized job table.

Bridge.SetJob

Sets the player's job and grade.

Bridge.GetGang

Returns a standardized gang table.

Bridge.SetGang

Sets the player's gang and grade.

Bridge.IsAdmin

Checks if the player has admin privileges (checks for 'command' ace permission).


Economy

Bridge.GetMoney

Retrieves the balance of a specific account.

Bridge.AddMoney

Adds money to a specific account.

Bridge.RemoveMoney

Removes money from a specific account.

Bridge.GetSocietyMoney

Gets the money associated with a job/society. Supports esx_addonaccount, qb-management, qb-banking, okokBanking, and Renewed-Banking.

Bridge.AddSocietyMoney / Bridge.RemoveSocietyMoney

Modifies society funds.


Basic Vehicle Management

Bridge.IsVehicleOwner

Checks if a player owns a vehicle with a specific plate.

Bridge.GetVehicleOwner

Returns the identifier of the owner of a specific plate.

Bridge.GeneratePlate

Generates a unique plate based on a pattern.

Bridge.GiveVehicle

Inserts a vehicle into the database (owned_vehicles / player_vehicles).

Last updated