# Exports

The following exports allow interaction with the `cad-identity` system. You can display identities, request them from users, generate fake identities, and manage licenses.

#### `showIdentity`

Display a specific identity for a player.

```lua
exports['cad-identity']:showIdentity(src, idtype, data)
```

**Parameters:**

- `src` _(number)_ – Player source ID.
- `idtype` _(string)_ – One of the identity types from `Config.Identities` (e.g., `'customidcard'`).
- `data` _(table, optional)_ – Identity metadata. Can include:

   ```lua
   {
     citizenid = data.citizenid,
     firstname = data.firstname,
     lastname = data.lastname,
     dob = data.dob,
     sex = data.gender,
     height = data.height,
     photo = data.photo
     -- Add other fields as needed based on the selected identity type.
   }
   ```

---

#### `requestIdentity`

Request the player to create or show an identity (with provided data or default player data).

```lua
exports['cad-identity']:requestIdentity(src, idtype, data)
```

**Parameters:**

- `src` _(number)_ – Player source ID.
- `idtype` _(string)_ – One of the identity types from `Config.Identities` (e.g., `'customidcard'`).
- **\`****data****\`** _(table, optional)_ – Identity metadata. Can include:

```lua
{
    citizenid  = data.citizenid,
    firstname  = data.firstname,
    lastname   = data.lastname,
    dob        = data.dob,
    sex        = data.gender,
    height     = data.height,
    photo      = data.photo,
    background = data.background
    -- Add other fields as needed based on the selected identity type.
}
```

---

#### `addLicense`

Assign a license to the player’s identity.

```lua
exports['cad-identity']:addLicense(src, license)
```

**Parameters:**

- **`src`** _(number)_ – Player source ID.
- **`license`** _(string)_ – One of the licenses defined in `Config.Identities` (e.g., `'driver'`).

---

#### `removeLicense`

Remove a license from the player’s identity.

```lua
exports['cad-identity']:removeLicense(src, license)
```

**Parameters:**

- **`src`** _(number)_ – Player source ID.
- **`license`** _(string)_ – One of the licenses defined in `Config.Identities` (e.g., `'driver'`).

---

#### Notes

- All identity types and licenses must be properly configured in your `Config.Identities`.
