> For the complete documentation index, see [llms.txt](https://striga.gitbook.io/striga-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://striga.gitbook.io/striga-docs/striga-core/exports/client-exports.md).

# Client Exports

Client functions of the Striga Core API.

```lua
local Core = exports['striga-core']:GetCore()
```

## Player

| Function                      | Returns                                                                       |
| ----------------------------- | ----------------------------------------------------------------------------- |
| `isReady()`                   | Core is ready                                                                 |
| `isLoggedIn()`                | Player is in game with a character                                            |
| `getProfile()`                | `{ charId, firstname, lastname, birthdate, gender, phone, money, job, gang }` |
| `getCharId()` / `getName()`   | Character id / first and last name                                            |
| `getMoney(account)`           | Money in that account                                                         |
| `getJob()` / `getGang()`      | `{ name, label, onDuty, isBoss, grade = { level, name, label } }`             |
| `getMetadata(key)`            | Framework metadata value (e.g. `stress`)                                      |
| `getNeeds()`                  | `{ hunger, thirst, stress }`, 0 to 100                                        |
| `framework()` / `inventory()` | Name of the active system                                                     |
| `getStaff()`                  | Staff info, for UI only (check on the server)                                 |

## Inventory

| Function                                                               | Returns                                                        |
| ---------------------------------------------------------------------- | -------------------------------------------------------------- |
| `getItems()`                                                           | List of `{ name, label, count, slot, weight, metadata }`       |
| `getItemCount(item)` / `hasItem(item, count?, metadata?)`              | Count / boolean                                                |
| `getItemLabel(item)` / `getItemData(item)`                             | Label / `{ label, weight, description, unique, useable, ... }` |
| `inventoryWeight()` / `inventoryMaxWeight()` / `inventoryFreeWeight()` | Weight                                                         |
| `getItemImage(item)`                                                   | `nui://` image URL for your NUI                                |
| `isInventoryOpen()` / `useSlot(slot)`                                  | Boolean                                                        |

## UI

| Group     | Functions                                                                                       |
| --------- | ----------------------------------------------------------------------------------------------- |
| Notify    | `notify(text, type?, duration?)` or `notify({ title, description, type, duration, icon, ... })` |
| Text UI   | `showTextUI(text, { key = 'E' })`, `updateTextUI(text)`, `hideTextUI(force?)`, `isTextUIOpen()` |
| Help text | `helpNotify(text, duration?)`                                                                   |

Notifications go to the system set in `notify`, text UI to the one set in `textui`. See [Notify](/striga-docs/striga-core/integration/notify.md) and [Text UI](/striga-docs/striga-core/integration/text-ui.md).

## Callbacks, vehicle, voice

| Function                  | Notes                                                              |
| ------------------------- | ------------------------------------------------------------------ |
| `callback(name, cb, ...)` | Calls a server callback from `registerCallback`                    |
| `getFuel(vehicle)`        | 0 to 100. See [Fuel](/striga-docs/striga-core/integration/fuel.md) |
| `getVoice()`              | pma-voice state                                                    |
| `getWeaponLabel(hash)`    | Weapon name                                                        |

## Settings and theme

The API table also has the settings hub and theme functions (`registerSettings`, `unregisterSettings`, `getSettingsProviders`, `setProviderSettings`, `previewProvider`, `resetProvider`, `notifySettingsChanged`, `setTheme`, `getTheme`). They work before core is ready. See [Settings Hub & Theme](/striga-docs/striga-core/settings-hub-and-theme.md).

## Language

The server language is set in `config.json` (`"locale"`) and with `/strigalocale`. Core reads **your** resource's `editable/locales/<code>.json` (the calling resource). `code` is optional: without it the active language is used.

| Export                            | Returns                                                                                                                      |
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `GetLocale()`                     | Active code, e.g. `'tr'`                                                                                                     |
| `LocaleText(key, params?, code?)` | `game[key]`, then English `game[key]`, then the key. `{name}` is filled from `params`; without params you get the raw string |
| `LocaleUi(path, code?)`           | Dotted lookup in `ui` (`'settings.title'`), string or table, English fallback                                                |
| `LocaleFiles(code?)`              | `localeRaw, fallbackRaw`: raw JSON of `<code>.json` and `en.json`, for your NUI                                              |
| `GetLocales()`                    | Array of codes that exist for your resource                                                                                  |

```lua
local text = exports['striga-core']:LocaleText('welcome', { name = 'Alex' })  -- "Welcome {name}" -> "Welcome Alex"
local title = exports['striga-core']:LocaleUi('settings.title')
```

A missing `<code>.json` prints one console warning and English is used. Listen to the [locale events](/striga-docs/striga-core/events.md) to refresh your texts when the language changes.

## Example

```lua
Core.callback('my-shop:getPrice', function(price)
    if price then Core.notify(('Price: $%s'):format(price)) end
end, 'water_bottle')

Core.showTextUI('Open shop', { key = 'E' })
Core.hideTextUI()
```

{% content-ref url="/pages/jE3SyzHTVPkjN81mDZ4I" %}
[Events](/striga-docs/striga-core/events.md)
{% endcontent-ref %}
