# Server Exports

### getMileageByEntity

Returns the mileage, in kilometers, of a specified entity. Will return false if the entity does not exist.

```lua
---@param vehicle integer
---@return number|false mileageKm
exports["jg-vehiclemileage"]:getMileageByEntity(vehicle)
```

### getMileageByPlate

Returns the mileage, in kilometers, of a specified vehicle plate. Will return false if the plate could not be found in the database.

{% hint style="warning" %}
This export makes a database call, so use sparingly.
{% endhint %}

```lua
---@param plate string
---@return number|false mileageKm
exports["jg-vehiclemileage"]:getMileageByPlate(plate)
```

### getUnit

Returns the config option of either `kilometers` or `miles` set in the jg-vehiclemileage config.

```lua
---@return "miles"|"kilometers"
exports["jg-vehiclemileage"]:getUnit()
```


---

# 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.jgscripts.com/vehicle-mileage/exports/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.
