# Exports & Usage

## 🖥️ Server Exports

These exports should be used from server-side scripts only.

***

### 🚙 GetAllRentalVehicles

Returns all active rental listings including live availability and rental status.

```lua
local vehicles = exports['dynyx_rentals']:GetAllRentalVehicles()
```

**Returns** `table` — Array of listing objects, each containing:

* **id** *(number)* Unique listing ID.
* **vehicle\_model** *(string)* The vehicle spawn name.
* **vehicle\_name** *(string)* Display name shown in the UI.
* **vehicle\_type** *(string)* Vehicle category.
* **vehicle\_plate** *(string)* License plate of the listed vehicle.
* **vehicle\_color** *(string)* Color name of the vehicle.
* **vehicle\_image\_url** *(string)* URL of the vehicle thumbnail image.
* **description** *(string)* Owner-written description of the listing.
* **rental\_price** *(number)* Base listing price.
* **hourly\_price** *(number)* Price charged per hour of rental.
* **owner\_citizenid** *(string)* Citizen ID of the player who listed the vehicle.
* **is\_available** *(boolean)* Whether the vehicle is currently available to rent.
* **is\_rented** *(boolean)* Whether the vehicle is currently out on an active rental.
* **rental\_expires\_at** *(string | nil)* ISO timestamp of when the active rental expires. `nil` if not rented.
* **renter\_citizenid** *(string | nil)* Citizen ID of the current renter. `nil` if not rented.


---

# 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://dynyx-scripts.gitbook.io/dynyx-scripts/rentals/exports-and-usage.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.
