# Player

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

## GetPlayerData

Returns the full player data object from the active framework.

```lua
local data = KOJA.Client.GetPlayerData()
```

**Returns** `table` — the framework's player data object.

:::hint{type="info"}
The structure depends on the framework. For ESX this is `ESX.GetPlayerData()`, for QBCore this is `QBCore.Functions.GetPlayerData()`.
:::

**Example**

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

## GetPlayerJob

Returns the name of the player's current job.

```lua
local job = KOJA.Client.GetPlayerJob()
```

**Returns** `string | nil`

**Example**

```lua
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.

```lua
local label = KOJA.Client.GetPlayerJobLabel()
```

**Returns** `string | nil`

**Example**

```lua
local label = KOJA.Client.GetPlayerJobLabel()
print('Job:', label)  -- e.g. "Police Department"
```

## IsDead

Returns whether the local player is dead.

```lua
local dead = KOJA.Client.IsDead()
```

**Returns** `boolean`

**Example**

```lua
if KOJA.Client.IsDead() then
    return
end
```

## Related pages

- [Callbacks](/koja-lib/api-reference/client-api/callbacks) — koja-lib provides a callback system that lets client scripts request data from the server and vice versa.
- [Inventory](/koja-lib/api-reference/client-api/inventory) — Client-side inventory functions let you check what items the local player has without a server round-trip.
- [DUI](/koja-lib/api-reference/client-api/dui) — DUI (Dynamic UI) allows you to render a web page as a texture on any in-game surface — screens, billboards, laptops, phones, etc.
- [Money](/koja-lib/api-reference/client-api/money) — Retrieve the local player's money balance from the client side via a server callback.
- [Keybinds](/koja-lib/api-reference/client-api/keybinds) — Register persistent key bindings that players can rebind in the GTA V settings menu.
- [Notifications](/koja-lib/api-reference/client-api/notifications) — koja-lib provides two notification interfaces: SendNotify (routes through the configured backend) and LibNotify (built-in koja-lib notification).
- [Client API](/koja-lib/api-reference/client-api) — back to the section overview
