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

# Exports

{% hint style="danger" %}
This is an ultra-realistic vehicle key system. Therefore, use the exports as recommended. If you put the `giveKey` export into every script, players will end up with hundreds of keys by the end of the day. Also, there is no `removeKey` export because this is a realistic key system. In real life, if you leave the key in the vehicle's ignition it stays there; if you take it out and put it in your pocket, it stays in your pocket, keys are not deleted. The script works exactly like this, provided you use the exports the recommended way.
{% endhint %}

### **Suggestions for Export Usage** <a href="#suggestions-for-export-usage" id="suggestions-for-export-usage"></a>

* When a player purchases or acquires a new vehicle, use the `GiveVehicleKey` or `GivePlateKey` exports to give them the key.
* In your garage scripts, use the `CheckIgnitionKeyOnSpawn` export. This way, if the player parked the vehicle with the key in the ignition, it will spawn in the same state. If they removed the key, it will already be with the player.
* For scripts where you don’t want the key to be removable from the ignition, such as jobs or driving schools, use the `SetUnremovableIgnition` export.

### **Client Exports** <a href="#client-exports" id="client-exports"></a>

***

#### **CheckIgnitionKeyOnSpawn**

If the vehicle's key is in the ignition when the vehicle is stored in the garage, and you trigger this export when retrieving the vehicle, it will put the key back in the ignition.

**You can use it to give keys in your garage script or different scripts**

**Note:** Event 'vehiclekeys:client:SetOwner' in qb triggers this export

```lua
exports["s1h_hotwire"]:CheckIgnitionKeyOnSpawn(vehicle, plate)
```

#### **Parameters :**

<table><thead><tr><th width="125">Name</th><th width="80">Type</th><th>Description</th></tr></thead><tbody><tr><td>vehicle</td><td>int</td><td>you don't have to use plate or vehicle data at the same time. just use one of them</td></tr><tr><td>plate</td><td>string</td><td>you don't have to use plate or vehicle data at the same time. just use one of them</td></tr></tbody></table>

***

#### **SetUnremovableIgnition**

You can use this export in situations where you don't want the vehicle's key to be removed. For example, if you have a farming job and you're spawning a vehicle, you can use this export to insert the key into the ignition, preventing the player from removing it!

```lua
exports["s1h_hotwire"]:SetUnremovableIgnition(vehicle, bool)
```

#### **Parameters :**

<table><thead><tr><th width="105">Name</th><th width="101">Type</th><th>Description</th></tr></thead><tbody><tr><td>vehicle</td><td>int</td><td>Vehicle entity id</td></tr><tr><td>bool</td><td>Bool</td><td>if true, put it on, if false, take it remove</td></tr></tbody></table>

***

#### **GivePlateKey**

Gives the player the vehicle key

```lua
exports["s1h_hotwire"]:GivePlateKey(plate, isNew)
```

#### **Parameters :**

<table><thead><tr><th width="100">Name</th><th width="111">Type</th><th>Description</th></tr></thead><tbody><tr><td>plate</td><td>text</td><td>Vehicle plate text</td></tr><tr><td>isNew</td><td>boolen</td><td>If true, the vehicle's key id changes and old keys cannot be used</td></tr></tbody></table>

***

#### **GiveVehicleKey**

Gives the player the vehicle key

```lua
exports["s1h_hotwire"]:GiveVehicleKey(vehicle, isNew)
```

#### **Parameters** :

<table><thead><tr><th width="98">Name</th><th width="87">Type</th><th>Description</th></tr></thead><tbody><tr><td>vehicle</td><td>int</td><td>Vehicle entity id</td></tr><tr><td>isNew</td><td>boolen</td><td>If true, the vehicle's key id changes and old keys cannot be used</td></tr></tbody></table>

***

#### **HasPlateKey**

Returns data on whether the player has a key to the vehicle

```lua
exports["s1h_hotwire"]:HasPlateKey(plate)
```

#### **Parameters :**

<table><thead><tr><th width="99">Name</th><th width="179">Type</th><th>Description</th></tr></thead><tbody><tr><td>plate</td><td>string</td><td>Vehicle plate text</td></tr></tbody></table>

***

#### **HasVehicleKey**

Returns data on whether the player has a key to the vehicle

```lua
exports["s1h_hotwire"]:HasVehicleKey(vehicle)
```

#### **Parameters :**

<table><thead><tr><th width="118">Name</th><th width="103">Type</th><th>Description</th></tr></thead><tbody><tr><td>vehicle</td><td>int</td><td>Vehicle entity id</td></tr></tbody></table>

***

#### **IsKeyInIgnition**

Returns data on whether the key is inserted in the ignition

```lua
exports["s1h_hotwire"]:IsKeyInIgnition(vehicle)
```

**Parameters :**

| Name    | Type | Description       |
| ------- | ---- | ----------------- |
| vehicle | int  | Vehicle entity id |

***

#### **SetIgnitionKeyStatus**

Inserts or removes the key in the ignition

```lua
exports["s1h_hotwire"]:SetIgnitionKeyStatus(vehicle, bool)
```

**Parameters :**

<table><thead><tr><th width="116">Name</th><th width="137">Type</th><th>Description</th></tr></thead><tbody><tr><td>vehicle</td><td>number</td><td>Vehicle entity id</td></tr><tr><td>bool</td><td>boolen</td><td>if true, put it on, if false, take it remove</td></tr></tbody></table>

***

#### **ToggleEngineStateButton**

Triggers the function of the button you use to turn the vehicle start and stop.

```lua
exports["s1h_hotwire"]:ToggleEngineStateButton(bool)
```

**Parameters :**

<table><thead><tr><th width="92">Name</th><th width="116">Type</th><th>Description</th></tr></thead><tbody><tr><td>bool</td><td>boolean</td><td>If the value is nill, it is started or stopped depending on the engine status</td></tr></tbody></table>

***

### **Server Exports**

***

#### **CheckIgnitionKeyOnSpawn**

If the vehicle's key is in the ignition when the vehicle is stored in the garage, and you trigger this export when retrieving the vehicle, it will put the key back in the ignition.

**You can use it to give keys in your garage script or different scripts**

```lua
exports["s1h_hotwire"]:CheckIgnitionKeyOnSpawn(netid, vehicle)
```

**Parameters :**

<table><thead><tr><th width="104">Name</th><th width="94">Type</th><th>Description</th></tr></thead><tbody><tr><td>netid</td><td>int</td><td>Vehicle Net Id (You don't have to use netid or vehicle data at the same time. just use one of them)</td></tr><tr><td>entity</td><td>int</td><td>Vehicle Entity Id (You don't have to use netid or vehicle data at the same time. just use one of them)</td></tr></tbody></table>

***

#### **SetUnremovableIgnition**

You can use this export in situations where you don't want the vehicle's key to be removed. For example, if you have a farming job and you're spawning a vehicle, you can use this export to insert the key into the ignition, preventing the player from removing it!

```lua
exports["s1h_hotwire"]:SetUnremovableIgnition(netid, entity, bool)
```

**Parameters :**

<table><thead><tr><th width="106">Name</th><th width="88">Type</th><th>Description</th></tr></thead><tbody><tr><td>netid</td><td>int</td><td>Vehicle Net Id (You don't have to use netid or vehicle data at the same time. just use one of them)</td></tr><tr><td>entity</td><td>int</td><td>Vehicle Entity Id (You don't have to use netid or vehicle data at the same time. just use one of them)</td></tr><tr><td>bool</td><td>bool</td><td>if true, put it on, if false, take it remove</td></tr></tbody></table>

***

#### **GivePlateKey**

Gives the player the vehicle key

```lua
exports["s1h_hotwire"]:GivePlateKey(src, plate, isNew)
```

**Parameters :**

<table><thead><tr><th width="91">Name</th><th width="95">Type</th><th>Description</th></tr></thead><tbody><tr><td>src</td><td>int</td><td>Player source</td></tr><tr><td>plate</td><td>text</td><td>Vehicle plate text</td></tr><tr><td>isNew</td><td>boolen</td><td>If true, the vehicle's key id changes and old keys cannot be used</td></tr></tbody></table>

***

#### **IsKeyInIgnition**

Returns data on whether the key is inserted in the ignition

```lua
exports["s1h_hotwire"]:IsKeyInIgnition(netid, entity)
```

**Parameters :**

<table><thead><tr><th width="98">Name</th><th width="70">Type</th><th>Description</th></tr></thead><tbody><tr><td>netid</td><td>int</td><td>Vehicle Net Id (You don't have to use netid or vehicle data at the same time. just use one of them)</td></tr><tr><td>entity</td><td>int</td><td>Vehicle Entity Id (You don't have to use netid or vehicle data at the same time. just use one of them)</td></tr></tbody></table>

***

#### **SetIgnitionKeyStatus**

Inserts or removes the key in the ignition

```lua
exports["s1h_hotwire"]:SetIgnitionKeyStatus(netid, entity, bool)
```

**Parameters :**

<table><thead><tr><th width="97">Name</th><th width="116">Type</th><th>Description</th></tr></thead><tbody><tr><td>netid</td><td>int</td><td>Vehicle Net Id (You don't have to use netid or vehicle data at the same time. just use one of them)</td></tr><tr><td>entity</td><td>int</td><td>Vehicle Entity Id (You don't have to use netid or vehicle data at the same time. just use one of them)</td></tr><tr><td>bool</td><td>boolen</td><td>if true, put it on, if false, take it remove</td></tr></tbody></table>

***
