carAndrew's Vehicle Spawner

triangle-exclamation

Dependency Required.

Overview

Andrew’s Vehicle Spawner is a FiveM resource that allows players to spawn vehicles from configurable categories, with optional ACE permissions per category or per individual vehicle.

Key Features:

  • Create multiple vehicle categories (e.g., Compacts, Sports, Emergency).

  • Restrict access to categories using ACE permissions.

  • Restrict individual vehicles within categories if desired.

  • Configurable keybind for opening the vehicle menu.

  • Optional automatic deletion of vehicles when spawning new ones or when access is denied.


Workflow

1️⃣ Opening the Vehicle Spawner

  • Default keybind is F6 (Config.Keybind = 167).

  • Pressing the key opens a menu listing all accessible vehicle categories.

2️⃣ Selecting a Category

  • Categories may require ACE permissions (useACEPermissions = true).

  • Only categories the player has access to are displayed.

3️⃣ Selecting a Vehicle

  • Each category contains vehicles with a label (display name) and model (spawn code).

  • Vehicles spawn at the player’s current location.

  • If Config.DeleteCurrentVehicle = true, the current vehicle is deleted before spawning a new one.

4️⃣ Access Restriction

  • Vehicles in categories can be restricted individually.

  • If a player enters a vehicle they do not have access to and Config.DeleteVehicles = true, the vehicle is automatically deleted.


Configuration (config.lua)

Keybind

Vehicle Deletion Options


Categories

Each category defines a group of vehicles and optional ACE permissions.

Notes:

  • label → The display name in the menu.

  • model → The vehicle spawn code used in the game.

  • requiredPermission → String representing the ACE permission required to access the category.

  • useACEPermissions → Set to true to enforce permission checks.


Example Categories

Category Name
ACE Permission Required
Vehicles

Compacts

No

Blista, Brioso R/A, Dilettante

Sports

No

Comet, Sultan RS, Ninef

Off-Road

No

Brawler, Dune Buggy, Sandking XL

Emergency

Yes

Police, Police2, Police3

The Emergency category is restricted by ACE permission (andrewvehicles.emergency).


Adding New Categories

  1. Copy an existing category block inside Config.Categories.

  2. Change the name, useACEPermissions, requiredPermission, and vehicles as needed.

  3. Add vehicles to vehicles using the format:


Restricting Individual Vehicles

  • Currently, vehicle restrictions are applied at the category level.

  • If you want to restrict individual vehicles, ensure useACEPermissions = true and define a separate category with only permitted vehicles.


Permissions

  • ACE permissions can be added in server.cfg:

  • Replace group.admin with your server group.


Optional Features

Feature
Config Option
Description

Delete current vehicle

Config.DeleteCurrentVehicle

Automatically deletes the current vehicle before spawning a new one.

Delete unauthorized vehicles

Config.DeleteVehicles

Deletes vehicles if the player does not have permission for the category.

Custom keybind

Config.Keybind

Change which key opens the spawner menu.


Usage

  1. Press F6 (or configured key) to open the vehicle menu.

  2. Select a category.

  3. Select a vehicle.

  4. Vehicle spawns at your current location.

  5. Unauthorized vehicles will be deleted if configured.


Customization Tips

  • Add more categories to organize vehicles by type or roleplay function.

  • Use ACE permissions to restrict premium or roleplay-specific vehicles.

  • Adjust DeleteCurrentVehicle to allow multiple vehicles per player if desired.

Last updated