# doc (1)

Character identity creation NUI for FiveM. Collects name, date of birth, gender, height, and nationality from the player when a new character is created. Triggered by kivo-multi-char or used standalone by any script.

***

## Installation Steps

{% stepper %}
{% step %}

### Place the resource

```
resources/
  [kivo]/
    kivo-identity-creator/
```

{% endstep %}

{% step %}

### Configure

Open `config.lua`. The critical value is `Config.callbackResource` — it must match the **exact folder name** of kivo-multi-char on your server:

```lua
Config.callbackResource = 'kivo-multi-char-DEMO'  -- change to your actual folder name
Config.selfHandle       = false                    -- true = standalone mode
```

Field visibility per framework — set any field to `false` to hide it:

```lua
Config.fields = {
    qbx = { firstname = true, lastname = true, dob = true, gender = true, height = true,  nationality = true  },
    qb  = { firstname = true, lastname = true, dob = true, gender = true, height = false, nationality = false },
    esx = { firstname = true, lastname = true, dob = true, gender = true, height = false, nationality = false },
}
```

{% endstep %}

{% step %}

### Add to server.cfg

{% tabs %}
{% tab title="QBX" %}

```
ensure oxmysql
ensure ox_lib
ensure qbx_core
ensure kivo-multi-char
ensure kivo-identity-creator
```

{% endtab %}

{% tab title="QBCore" %}

```
ensure oxmysql
ensure ox_lib
ensure qb-core
ensure kivo-multi-char
ensure kivo-identity-creator
```

{% endtab %}

{% tab title="ESX" %}

```
ensure oxmysql
ensure ox_lib
ensure es_extended
ensure kivo-multi-char
ensure kivo-identity-creator
```

{% endtab %}
{% endtabs %}
{% endstep %}
{% endstepper %}

***

## Features

* Per-framework field visibility (show only what your framework uses)
* Fires `kivo-multichar:identityCreated` on confirm, `kivo-multichar:identityBack` on Back
* Standalone mode: writes to DB directly without kivo-multi-char
* Custom camera and ped position for standalone mode

***

## Config Reference

| Key                        | Default                            | Description                                            |
| -------------------------- | ---------------------------------- | ------------------------------------------------------ |
| `Config.selfHandle`        | `false`                            | `true` = standalone mode, resource writes to DB itself |
| `Config.callbackEvent`     | `'kivo-multichar:identityCreated'` | Client event fired when player confirms the form       |
| `Config.callbackResource`  | `'kivo-multi-char-DEMO'`           | Exact folder name of kivo-multi-char — must match      |
| `Config.backEvent`         | `'kivo-multichar:identityBack'`    | Client event fired on Back button                      |
| `Config.defaultCam.coords` | —                                  | Standalone: camera world position                      |
| `Config.defaultCam.rot`    | —                                  | Standalone: camera rotation                            |
| `Config.defaultCam.fov`    | `50.0`                             | Standalone: field of view                              |
| `Config.defaultPedCoords`  | —                                  | Standalone: ped world position + heading               |
| `Config.blankPedModel`     | `'mp_m_freemode_01'`               | Standalone: ped model displayed during creation        |

***

## Kivo Suite Integration

In kivo-multi-char's `config.lua`:

```lua
Config.useIdentityCreator = true
```

{% stepper %}
{% step %}

### Player clicks "Create Character"

kivo-multi-char opens kivo-identity-creator
{% endstep %}

{% step %}

### Player fills the form

Player confirms → `kivo-multichar:identityCreated` fires
{% endstep %}

{% step %}

### kivo-multi-char writes character to DB

Then triggers spawn
{% endstep %}

{% step %}

### Player presses Back

`kivo-multichar:identityBack` fires → returns to character select
{% endstep %}
{% endstepper %}

To skip this resource entirely set `Config.useIdentityCreator = false` in kivo-multi-char — it will use `lib.inputDialog` instead.

***

## Standalone Mode

Set `Config.selfHandle = true`. The resource will:

{% stepper %}
{% step %}

### Place a blank ped

Use `Config.defaultPedCoords` with `Config.blankPedModel`
{% endstep %}

{% step %}

### Open the identity form

Use the camera at `Config.defaultCam`
{% endstep %}

{% step %}

### Write identity data to the DB

{% endstep %}

{% step %}

### Fire `Config.callbackEvent`

When complete
{% endstep %}
{% endstepper %}

***

## Troubleshooting

1. **Form submits but character never creates**
   * `Config.callbackResource` does not match the kivo-multi-char folder name exactly — check spelling and casing
2. **Wrong fields shown for my framework**
   * Confirm `shared/framework.lua` is detecting the correct framework
   * Check `Config.fields` for the matching key (`qbx`, `qb`, or `esx`)
3. **Camera is wrong in standalone mode**
   * Adjust `Config.defaultCam.coords` and `Config.defaultPedCoords` to a clear spot on your map


---

# Agent Instructions: 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:

```
GET https://docs.kivostudios.net/maps/doc-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
