For the complete documentation index, see llms.txt. This page is also available as Markdown.

Client

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

local Lib47 = exports['ak47_lib']:GetLibObject()

Lib47.Framework

A built-in variable that stores the active framework detected by the library. This is highly useful for writing dynamic, multi-framework scripts that need to execute different logic depending on the server's core environment.

Expected Values: 'esx', 'qb', or 'qbx'.

--- @type string The name of the currently active framework
local currentFramework = Lib47.Framework

-- Example usage for framework-specific logic
if Lib47.Framework == 'qb' then
    print("Detected Framework: QBCore")
    -- Execute QBCore specific code here
    
elseif Lib47.Framework == 'esx' then
    print("Detected Framework: ESX")
    -- Execute ESX specific code here
    
elseif Lib47.Framework == 'qbx' then
    print("Detected Framework: Qbox")
    -- Execute Qbox specific code here
    
else
    print("No supported framework detected (Standalone)")
end

Lib47.GetCoreConfig

Retrieves the main configuration table of the active framework (e.g., QBCore.Config or ESX.GetConfig()). This is highly useful for fetching default framework settings without needing to directly reference the core objects, keeping your script standalone-friendly.

Note: When using ESX, you can optionally pass a specific string key to return a single value instead of the entire table. In QBCore/Qbox, the key parameter is ignored and the full configuration table is always returned.

Client Player Data

These functions allow you to access player data directly on the client side, updated automatically when framework events fire.

Lib47.GetJob

Returns the local player's job data standardized.

Lib47.GetPlayerData

Returns the raw framework-specific player data table (QBCore.PlayerData or ESX PlayerData).

Lib47.GetTargetMetaValue

A utility function to fetch metadata from another player (server-side) via a callback. Useful for checking status like isdead or inlaststand on a target player.

Lib47.GetCoreConfig

Retrieves the active framework's core configuration table.

Lib47.GetIdentifier

Returns the unique identifier (CitizenID/Identifier) for the local player directly from the client.

Lib47.GetCharacterName

Returns the full character name of the local player.

Lib47.AddStress / Lib47.RemoveStress

Modifies the local player's stress levels across frameworks.

Here is the missing client-side documentation formatted in Markdown, ready to be added to your official API reference.

Last updated