> For the complete documentation index, see [llms.txt](https://docs.redutzu.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.redutzu.com/resources/redutzu-mdt/exports-events/server-exports/vehicles.md).

# Vehicles

Here, you'll find key exports for managing vehicles. These exports allow you to register and update vehicles as needed.

***

## Type

```typescript
type Vehicle = {
    plate: string,
    hash: string, // depends on your framework
    notes?: string,
    image?: string,
    owner: {
       identifier: string,
       name: string
    },
    gallery: {
       id: number,
       value: string,
       description: string
    }[],
    incidents: {
       id: number,
       createdAt: string
    }[],
    bolos: {
       id: number,
       createdAt: string
    }[]
}
```

## Exports

### RegisterVehicle

```lua
exports['redutzu-mdt']:RegisterVehicle({
  plate = 'ABC1234',
  owner = 'license:1234',
  model = 'hash/model',
  notes = 'Vehicle notes',
  image = 'https://yourwebsite.com/'
}) -- boolean
```

### SearchVehicle

```lua
exports['redutzu-mdt']:SearchVehicle(plate: string) // VehicleType | null
```

### UpdateVehicle

```lua
-- It returns a boolean (if it was successfully updated)
exports['redutzu-mdt']:UpdateVehicle(plate, {
  image = 'https://yourwebsite.com/'
}) -- boolean
```

```lua
local success = exports['redutzu-mdt']:UpdateVehicle('ABC1234', {
    image = 'https://yourwebsite.com/'
})

if not success then
    print('There was an error updating the vehicle')
    return
end

print('Vehicle updated')
```
