> For the complete documentation index, see [llms.txt](https://zloma-scripts.gitbook.io/zloma-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zloma-scripts.gitbook.io/zloma-scripts/zloma_keys-free-escrow/api-reference/server-exports.md).

# Server Exports

Server-side exports allow other resources to give, remove, and check vehicle keys for players.

***

## GiveKeyToPlayer

Gives a physical key item for a specific vehicle plate to a player.

```lua
exports['zloma_keys']:GiveKeyToPlayer(source, plate, model, label)
```

| Parameter | Type             | Description                              |
| --------- | ---------------- | ---------------------------------------- |
| `source`  | number           | Player server ID                         |
| `plate`   | string           | Vehicle plate (automatically normalized) |
| `model`   | string \| number | Vehicle model name or hash               |
| `label`   | string           | Display name shown in inventory metadata |

**Returns:** `boolean` — `true` on success, `false` on failure.

**Example:**

```lua
local plate = GetVehicleNumberPlateText(vehicle)
local success = exports['zloma_keys']:GiveKeyToPlayer(source, plate, 'adder', 'Adder')
```

***

## RemoveKeyFromPlayer

Removes a physical key item matching the given plate from a player's inventory.

```lua
exports['zloma_keys']:RemoveKeyFromPlayer(source, plate)
```

| Parameter | Type   | Description                              |
| --------- | ------ | ---------------------------------------- |
| `source`  | number | Player server ID                         |
| `plate`   | string | Vehicle plate (automatically normalized) |

**Returns:** `boolean` — `true` if a matching key was found and removed, `false` otherwise.

**Example:**

```lua
exports['zloma_keys']:RemoveKeyFromPlayer(source, plate)
```

***

## PlayerHasKey

Checks whether a player currently holds a key for the given plate.

```lua
exports['zloma_keys']:PlayerHasKey(source, plate)
```

| Parameter | Type   | Description                              |
| --------- | ------ | ---------------------------------------- |
| `source`  | number | Player server ID                         |
| `plate`   | string | Vehicle plate (automatically normalized) |

**Returns:** `boolean` — `true` if the player has a matching key item, `false` otherwise.

**Example:**

```lua
if exports['zloma_keys']:PlayerHasKey(source, plate) then
    -- player has the key
end
```


---

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

```
GET https://zloma-scripts.gitbook.io/zloma-scripts/zloma_keys-free-escrow/api-reference/server-exports.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.
