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

# devix-core

Source: [devix-core (GitBook)](https://devix.gitbook.io/devix/devix-core)

All API access goes through `getObjects()`; functions are called on the returned table.

```lua
local DEVIX = exports['devix-core']:getObjects()
DEVIX.GetPlayer(source)
```

## Configuration

Config is in **`shared/config.lua`**. Options and what they do:

| Option                  | Type    | Description                                                                                                                                                                                                                                                                                                                              |
| ----------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Framework**           | string  | Which framework devix-core talks to. Use exactly one: `"qb"` (QBCore), `"oldqb"` (legacy QBCore), `"qbox"` (QBox / qbx\_core), `"esx"`, `"oldesx"`, `"ox"` (Overextended). For QBox, start `qbx_core` **before** devix-core in server.cfg; client may need `@qbx_core/modules/playerdata.lua` in fxmanifest before devix client scripts. |
| **Mysql**               | string  | MySQL resource name used for DB calls (e.g. `"oxmysql"`).                                                                                                                                                                                                                                                                                |
| **CoreName**            | string  | Core resource name (default `"devix-core"`).                                                                                                                                                                                                                                                                                             |
| **CoreVersion**         | string  | Version string for display/logs.                                                                                                                                                                                                                                                                                                         |
| **Debug**               | boolean | When `true`, `DEVIX.debug(...)` prints to the server/client console. Set `false` in production.                                                                                                                                                                                                                                          |
| **CashAsItem**          | boolean | When `true`, cash is handled as an inventory item: `GetMoney`/`AddMoney`/`RemoveMoney` with type `"cash"` use devix-inventory instead of framework money. Requires devix-inventory and a cash item in the shared item list. Works with QB and ESX.                                                                                       |
| **CashItemName**        | string  | Item name used for cash when **CashAsItem** is `true` (e.g. `"cash"`). Must exist in your item config.                                                                                                                                                                                                                                   |
| **OxInventoryBridge**   | boolean | When `true`, if the ox\_inventory bridge has no usable handler for an item, devix-core can trigger use via the bridge’s items definition (client/server exports/events). Keeps compatibility with scripts that expect ox\_inventory usables.                                                                                             |
| **RestartDependencies** | table   | List of resource names that are restarted when devix-core is restarted (e.g. devix-multicharacter, devix-inventory, devix-tablet). Ensures dependent devix resources stay in sync. Do not add `ox_inventory` here if other scripts depend on it; restarting it can cause "No such export" errors.                                        |
| **AuthorizedLicenses**  | table   | List of license identifiers (e.g. `"license:xxxx..."`) that have devix-core permission (e.g. admin). Used by `DEVIX.HasPermission(source)` or `HasPermission(license)`.                                                                                                                                                                  |

## Export

| File                                          | Description                                |
| --------------------------------------------- | ------------------------------------------ |
| [getObjects](/devix/devix-core/getobjects.md) | Returns the DEVIX table (Server & Client). |

***

## Server — Player & data

| File                                                                    | Description                                          |
| ----------------------------------------------------------------------- | ---------------------------------------------------- |
| [GetPlayer](/devix/devix-core/getplayer.md)                             | Returns the framework player object.                 |
| [GetPlayerIdentifier](/devix/devix-core/getplayeridentifier.md)         | Player's unique id (citizenid, identifier, stateId). |
| [GetDataPlayer](/devix/devix-core/getdataplayer.md)                     | Table with account, phone, joblabel.                 |
| [GetPlayerJob](/devix/devix-core/getplayerjob.md)                       | Player's job table (name, label, grade).             |
| [GetPlayerName](/devix/devix-core/getplayername.md)                     | Player display name.                                 |
| [GetPlayerFromIdentifier](/devix/devix-core/getplayerfromidentifier.md) | Player object from identifier.                       |
| [GetPlayerSource](/devix/devix-core/getplayersource.md)                 | Server id (source) from player object.               |
| [GetPlayerLicense](/devix/devix-core/getplayerlicense.md)               | Player's license identifier.                         |

***

## Server — Inventory & items

| File                                                    | Description                                                  |
| ------------------------------------------------------- | ------------------------------------------------------------ |
| [AddItem](/devix/devix-core/additem.md)                 | Gives an item to the player (devix-inventory/ox\_inventory). |
| [RemoveItem](/devix/devix-core/removeitem.md)           | Removes an item from the player.                             |
| [GetItemAmount](/devix/devix-core/getitemamount.md)     | Whether the player has at least that amount (boolean).       |
| [getItemInfo](/devix/devix-core/getiteminfo.md)         | Item info (amount/count etc.).                               |
| [GetInventory](/devix/devix-core/getinventory.md)       | Player's inventory table.                                    |
| [GetItemLabel](/devix/devix-core/getitemlabel.md)       | Item display label.                                          |
| [GetSharedItem](/devix/devix-core/getshareditem.md)     | Shared item definition (label, weight, type).                |
| [GetSharedWeapon](/devix/devix-core/getsharedweapon.md) | Shared weapon data for hash.                                 |
| [CanUseItem](/devix/devix-core/canuseitem.md)           | Whether the item is usable (registered).                     |

***

## Server — Money

| File                                            | Description                                  |
| ----------------------------------------------- | -------------------------------------------- |
| [AddMoney](/devix/devix-core/addmoney.md)       | Adds money to the player (cash, bank, etc.). |
| [RemoveMoney](/devix/devix-core/removemoney.md) | Removes money from the player.               |
| [GetMoney](/devix/devix-core/getmoney.md)       | Player's money amount for a type.            |

***

## Server — Usable items

| File                                                  | Description                                                 |
| ----------------------------------------------------- | ----------------------------------------------------------- |
| [UsableItem](/devix/devix-core/usableitem.md)         | Registers a callback when the item is used.                 |
| [CallUsableItem](/devix/devix-core/callusableitem.md) | Triggers the item handler (e.g. called by devix-inventory). |

***

## Server — Characters & auth

| File                                                                  | Description                             |
| --------------------------------------------------------------------- | --------------------------------------- |
| [CreateNewCharacter](/devix/devix-core/createnewcharacter.md)         | Creates a new character.                |
| [PlayerLogin](/devix/devix-core/playerlogin.md)                       | Logs the player in with that character. |
| [LogoutPlayer](/devix/devix-core/logoutplayer.md)                     | Logs the player out.                    |
| [DeleteCharacter](/devix/devix-core/deletecharacter.md)               | Deletes a character.                    |
| [GetCharactersByLicense](/devix/devix-core/getcharactersbylicense.md) | All characters for a license.           |
| [GetSkinByCitizenid](/devix/devix-core/getskinbycitizenid.md)         | Character's saved skin/appearance.      |

***

## Server — Other

| File                                                                  | Description                                           |
| --------------------------------------------------------------------- | ----------------------------------------------------- |
| [Notify](/devix/devix-core/notify.md)                                 | Sends a notification to the player (Server & Client). |
| [HasPermission](/devix/devix-core/haspermission.md)                   | Admin/permission check.                               |
| [GiveVehicle](/devix/devix-core/givevehicle.md)                       | Gives a vehicle to the player.                        |
| [GeneratePlate](/devix/devix-core/generateplate.md)                   | Generates a random plate.                             |
| [ExecuteSql](/devix/devix-core/executesql.md)                         | MySQL query (async callback).                         |
| [ExecuteSqlSync](/devix/devix-core/executesqlsync.md)                 | MySQL query (synchronous).                            |
| [RegisterServerCallback](/devix/devix-core/registerservercallback.md) | Registers a server callback.                          |
| [TriggerServerCallback](/devix/devix-core/triggerservercallback.md)   | Triggers a registered server callback.                |
| [debug](/devix/devix-core/debug.md)                                   | Prints to console when Config.Debug is on.            |

***

## Server — Properties (read-only)

| File                                                    | Description                                 |
| ------------------------------------------------------- | ------------------------------------------- |
| [Framework](/devix/devix-core/framework.md)             | Current framework name (qbox, qb, esx, ox). |
| [UsableItems](/devix/devix-core/usableitems.md)         | Registered usable item names → callback.    |
| [UsableItemsMeta](/devix/devix-core/usableitemsmeta.md) | Usable item meta (debug).                   |
| [ServerCallbacks](/devix/devix-core/servercallbacks.md) | Registered callback names → function.       |

***

## Client — Player & data

| File                                                                     | Description                        |
| ------------------------------------------------------------------------ | ---------------------------------- |
| [CL\_GETDATA](/devix/devix-core/cl_getdata.md)                           | Local player data (common format). |
| [CL\_GETDATA\_ID](/devix/devix-core/cl_getdata_id.md)                    | Local player citizenid/identifier. |
| [GetPlayerJobName\_CL](/devix/devix-core/getplayerjobname_cl.md)         | Local player job name.             |
| [GetPlayerName\_CL](/devix/devix-core/getplayername_cl.md)               | Local player name (first/last).    |
| [GetPlayerData](broken://pages/6188c0d05a598634f21fa625f7f6cafa67a529c5) | Framework-specific local data.     |
| [SetPlayerData](/devix/devix-core/setplayerdata.md)                      | Updates local player data.         |
| [GetFramework](/devix/devix-core/getframework.md)                        | Current framework name (client).   |

***

## Client — World & vehicles

| File                                                                  | Description                        |
| --------------------------------------------------------------------- | ---------------------------------- |
| [GetClosestPlayer](/devix/devix-core/getclosestplayer.md)             | Closest player ped and distance.   |
| [GetPlayersFromCoords](/devix/devix-core/getplayersfromcoords.md)     | Players within distance of coords. |
| [GetStreetNametAtCoords](/devix/devix-core/getstreetnametatcoords.md) | Street name at coords.             |
| [GetZoneAtCoords](/devix/devix-core/getzoneatcoords.md)               | Zone name at coords.               |
| [GetVehicleProperties](/devix/devix-core/getvehicleproperties.md)     | Vehicle mods/props table.          |
| [SetVehicleProperties](/devix/devix-core/setvehicleproperties.md)     | Applies props to vehicle.          |

***

## Client — Animation & UI

| File                                                        | Description                    |
| ----------------------------------------------------------- | ------------------------------ |
| [loadAnimationDict](/devix/devix-core/loadanimationdict.md) | Loads an animation dictionary. |
| [setAnimation](/devix/devix-core/setanimation.md)           | Plays animation on ped.        |
| [removeAnimation](/devix/devix-core/removeanimation.md)     | Stops animation.               |

***

## Client — Items & callbacks

| File                                                                                | Description                               |
| ----------------------------------------------------------------------------------- | ----------------------------------------- |
| [TriggerServerCallback (client)](/devix/devix-core/triggerservercallback-client.md) | Server callback call (client side).       |
| [GetSharedItem](/devix/devix-core/getshareditem.md)                                 | Shared item definition (Server & Client). |
| [GetSharedWeapon](/devix/devix-core/getsharedweapon.md)                             | Shared weapon data (Server & Client).     |
| [debug](/devix/devix-core/debug.md)                                                 | Debug console output (Server & Client).   |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://devix.gitbook.io/devix/devix-core.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
