# AF Garage
Video Showcase : https://youtu.be/xneX_heyPeo?si=UQO9DzS4f1IchIqU
**QBCore / QBX garage system** — Store, retrieve, and manage player vehicles with a clean UI and full key-system supports
---
## Features
- **Take out vehicles** — Open the garage menu (E key in zone), pick a vehicle from your list, and spawn it with saved mods and fuel. You are placed in the driver seat with the engine on and keys given automatically.
- **Park vehicles** — Drive into the park zone and press E while stationary to store the vehicle. Mods and fuel are saved to the database.
- **Garage types** — Support for **public** (everyone), **job** (e.g. police, ambulance), and **gang** garages. Job garages show blips only to players with that job.
- **Vehicle categories** — Separate garages for **cars**, **air**, and **boat**; each garage only lists vehicles of its type.
- **Vehicle key integration** — Works with common key scripts so players get keys when taking a vehicle out:
- **QB:** qb-vehiclekeys
- **QBX:** qbx_vehiclekeys (with fallback)
- **Other:** qs-vehiclekeys, wasabi_carlock, cd_garage
- **ESX:** configurable client event (e.g. esx_vehiclelock, esx_carkey)
- Engine stays on after spawn; no hotwiring required.
- **Fuel systems** — Saves and restores fuel with **LegacyFuel** or **ox_fuel** when parking and taking out vehicles.
- **Map blips** — Optional blips per garage (sprite, colour, label). Job garages only show blips to players in that job.
- **Admin garage creation** — `/admingarage` (restricted by config) lets allowed admins create new garages in-game: set name, type, job, vehicle type, and use current position for take/spawn/park points. New garages sync to all players and can be saved to the database (including temporary garages removed on restart).
- **NUI interface** — Simple garage panel with search, theme toggle, and plate-style visuals. ESC to close.
- **Localisation** — Translation keys for errors, success messages, and UI text (e.g. Turkish locale included).
- **Ox_lib zones** — No target required; sphere zones for open-garage and park-vehicle with text UI (E to interact).
---
## Requirements
- **QBCore** or **QBX** (qbx_core)
- **ox_lib**
- **oxmysql**
- **player_vehicles** table (standard QBCore schema with `state`, `garage`, `mods`, etc.)
- Optional: qb-vehiclekeys / qbx_vehiclekeys (or other key script), LegacyFuel or ox_fuel
---
## Quick config
- **Config.VehicleKeys** — Set to your key script: `'qb-vehiclekeys'`, `'qbx_vehiclekeys'`, `'qs-vehiclekeys'`, `'wasabi_carlock'`, `'cd_garage'`, `'esx_vehiclelock'`, `'esx_carkey'`, or `'none'`.
- **Config.AdminGarageAllowed** — List of `{ type = 'discord', value = 'ID' }` (or fivem, license, etc.) to allow `/admingarage`.
- **Config.Garages** — Predefined garages with `takeVehicle`, `spawnPoint`, `parkVehicle` (vector4), `type`, `vehicleType`, and optional blip settings.
---
**AF Garage** — Lightweight, key-system friendly, and easy to configure for your server.
