# Exports

## Client

### hasKey(plate, forceOwner)

Checks if a player has a vehicle key.

<mark style="color:blue;">**Parameters:**</mark>\
**plate** - `string` - The vehicle plate\
**forceOwner** - `boolean` - Has to be the vehicle owner?

<mark style="color:green;">**Returns:**</mark>\
`true/false` - True or false

<mark style="color:orange;">**Example:**</mark>

```lua
local state = exports.zrx_carlock:hasKey(vehicle, false)

if state then
    print('yes')
else
    print('no')
end
```

***

### giveKey(plate)

Gives the vehicle key.

<mark style="color:blue;">**Parameters:**</mark>\
**plate** - `string` - The vehicle plate

<mark style="color:orange;">**Example:**</mark>

```lua
exports.zrx_carlock:giveKey('ABC123')
```

***

### removeKey(plate)

Removes the vehicle key.

<mark style="color:blue;">**Parameters:**</mark>\
**plate** - `string` - The vehicle plate

<mark style="color:orange;">**Example:**</mark>

```lua
exports.zrx_carlock:removeKey('ABC123')
```

***

### openKeyMenu()

Opens the givekey menu.

<mark style="color:orange;">**Example:**</mark>

```lua
exports.zrx_carlock:openKeyMenu()
```

***

## Server

### hasKey(player, plate, forceOwner)

Checks if a player has a vehicle key.

<mark style="color:blue;">**Parameters:**</mark>\
**player** - `number` - The player server id\
**plate** - `string` - The vehicle plate\
**forceOwner** - `boolean` - Has to be the vehicle owner?

<mark style="color:green;">**Returns:**</mark>\
`true/false` - True or false

<mark style="color:orange;">**Example:**</mark>

```lua
local state = exports.zrx_carlock:hasKey(1, vehicle, false)

if state then
    print('yes')
else
    print('no')
end
```

***

### giveKey(player, plate)

Gives the vehicle key.

<mark style="color:blue;">**Parameters:**</mark>\
**player** - `number` - The player server id\
**plate** - `string` - The vehicle plate

<mark style="color:orange;">**Example:**</mark>

```lua
exports.zrx_carlock:giveKey(1, 'ABC123')
```

***

### removeKey(player, plate)

Removes the vehicle key.

<mark style="color:blue;">**Parameters:**</mark>\
**player** - `number` - The player server id\
**plate** - `string` - The vehicle plate

<mark style="color:orange;">**Example:**</mark>

```lua
exports.zrx_carlock:removeKey(1, 'ABC123')
```

***

### updatePlate(oldPlate, newPlate)

Removes the vehicle key.

<mark style="color:blue;">**Parameters:**</mark>\
**oldPlate** - `string` - The vehicle old plate\
**newPlate** - `string` - The vehicle new plate

<mark style="color:orange;">**Example:**</mark>

```lua
local oldPlate = 'ABC123'
local newPlate = '123ABC'

exports.zrx_carlock:updatePlate(oldPlate, newPlate)
```


---

# 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.zrxnx.at/zrxnx-scripts/scripts/zrx_carlock/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.
