> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apex-services.site/llms.txt
> Use this file to discover all available pages before exploring further.

# APEX Carclear

> Scheduled vehicle cleanup with garage forwarding.

Scheduled unoccupied-vehicle cleanup for FiveM / ESX. Runs every hour within a configurable time window, warns players 5 minutes ahead, skips vehicles with players inside or nearby, batches deletions for server stability, and forwards owned vehicles to your garage / impound system via a hook.

## Features

* Hourly auto-cleanup within a configurable local-time window (wraps across midnight)
* 5-minute player warning before the sweep fires
* Skips occupied + nearby vehicles (30m radius, configurable)
* Batched deletions — 50 vehicles per batch, 500ms between, never hangs the tick
* Owned vehicle forwarding — hook-based `ImpoundOwnedVehicles` keeps `owned_vehicles` intact
* Manual commands — `/clearvehicles` + `/quickclear` (10-sec warning)
* AdvancedParking / qbx\_vehiclegarages friendly via `BeforeEntityDelete`
* en/de localization with real umlauts

## Requirements

<CardGroup cols={2}>
  <Card title="Required" icon="circle-check">
    `es_extended`, `ox_lib`, `oxmysql`
  </Card>

  <Card title="Optional" icon="puzzle-piece">
    Garage / impound resource (via `Hooks.ImpoundOwnedVehicles`), `AdvancedParking` / `qbx_vehiclegarages` (via `Hooks.BeforeEntityDelete`)
  </Card>
</CardGroup>

## Configuration

```lua config.lua theme={null}
Config.ClearIntervalMs     = 3600000     -- 1 hour
Config.WarningTimeMs       = 300000      -- 5 min warning
Config.QuickWarningTimeMs  = 10000       -- 10 sec for /quickclear
Config.BatchSize           = 50
Config.BatchDelayMs        = 500
Config.PlayerCheckDistance = 30.0
Config.ClearStartHour      = 18
Config.ClearEndHour        = 1
Config.CommandGroups       = {}          -- empty = console/rcon only
```

Excluded-model list for utility/persistent vehicles. Vehicle table name is configurable and validated at startup. Commands are gated by ESX group.

## Hooks

See [Hooks reference / Carclear](/hooks/apex-carclear). Key hooks: `Hooks.ImpoundOwnedVehicles`, `Hooks.BeforeEntityDelete`, `Hooks.NotifyAll`, `Hooks.OnAuditLog`.

## Resource info

<Note>
  Code accessible: `config.lua`, `hooks.lua`, `locales/*`. Approximately 600 lines of Lua. English + German.
</Note>
