Player

Functions for reading the local player's data on the client side.

GetPlayerData

Returns the full player data object from the active framework.

local data = KOJA.Client.GetPlayerData()

Returns table — the framework's player data object.

The structure depends on the framework. For ESX this is ESX.GetPlayerData(), for QBCore this is QBCore.Functions.GetPlayerData().

Example

local data = KOJA.Client.GetPlayerData()
print(data.job.name)

GetPlayerJob

Returns the name of the player's current job.

local job = KOJA.Client.GetPlayerJob()

Returns string | nil

Example

local job = KOJA.Client.GetPlayerJob()
if job == 'police' then
    -- player is a cop
end

GetPlayerJobLabel

Returns the display label of the player's current job.

Returns string | nil

Example

IsDead

Returns whether the local player is dead.

Returns boolean

Example