Skip to content

arlofonseca/fivem-parking

Repository files navigation

fivem-parking

A simple vehicle garage system created with a more versatile structure, allowing players to manage their vehicles from any location.

Features

  • Utilizes Prisma to interact with your database.
  • The process of spawning vehicles is primarily handled by ox_core.
  • Supports logging via Discord.
  • Administrators have the ability to manage and oversee vehicles via command.

Installation

If you download the source code via the green Code button, you'll need to build the resource. Information on how to do this is provided below. If you prefer not to build it, you can download latest release and drag and drop it into your server. However, any changes made to the built resource will need to be re-built to apply the changes.

Dependencies

Building this resource

  1. Download and install the LTS version of Node.js.
  2. Open a command-line terminal (e.g., Terminal, Command Prompt).
  3. Enter node --version to verify the installation.
  4. Run npm install -g pnpm to globally install the package manager pnpm.
  5. Download or clone the repository with git clone https://github.com/arlofonseca/fivem-parking.
  6. Install all dependencies with pnpm i.
  7. Create a new file named .env within the root directory.
  8. Copy the contents of .env.example to the newly created .env file and edit accordingly.
  9. Connect your database with pnpm pull to add Prisma models to schema.prisma.
  10. Generate Prisma client using pnpm generate.
  11. Build the resource with pnpm build.

Use pnpm watch to rebuild whenever a file is modified.

Usage

Commands

/list (alias: /vl)

  • Displays a list of your owned vehicles.

/get [vehicleId] (alias: /vg)

  • Retrieve your vehicle from your vehicle garage via its unique identifier.

If you do not know the unique identifier of your vehicle, you can find it when executing the /list command.

/park (alias: /vp)

  • Stores your vehicle into your vehicle garage.

/impound [vehicleId] (alias: /rv)

  • Retrieve your vehicle from the impound via its unique identifier, restoring it to the stored state.

This will only work if you are within the radius of the location defined in config.json.

[ADMIN] /adeletevehicle [plate] (alias: /delveh)

  • Removes a vehicle from the database.

This action cannot be reversed.

[ADMIN] /admincar [model] (alias: /acar)

  • Spawns a vehicle and saves it to both the database and your vehicle garage.

[ADMIN] /addvehicle [playerId] [model]

  • Adds a vehicle to the target player's vehicle garage.

[ADMIN] /playervehicles [playerId]

  • Displays a list of the target player's owned vehicles.

Credits

  • BerkieB originally made this resource. I wanted it publicly available, so here it is.