πŸ’»Installation

How to install the script

1. Run Database

  1. Open the file database.sql

  2. Open your database and run it

2. ⚠️arrow-up-right IMPORTANT (Garage and Spawn)

Custom Garage

Export to add for CUSTOM GARAGE (false in clConfig.GarageEnable)

WARNING: Upon the first run of the script, all vehicles will be placed in a garage. If you're using custom garages, remove all vehicles from various impound lots (putting them in a garage) and deactivate any impound functions present in your custom garage. Then, you'll need to use my impound. If you delete some vehicles from my database, the same logic will apply, returning them to the pre-set garage in your garage table.

Our Garage

(true in clConfig.GarageEnable): If you wish to utilize our garage system, all vehicles are initially placed in a random garage registered in the garagesConfig. This process only occurs the first time you use the script, or if you delete some vehicles from my database, in which case they will be reinserted into a random garage. Afterwards, you can freely move your vehicles, and everything will function smoothly.

No Garage

(false in clConfig.GarageEnable): If you're not using any garage system initially, we recommend starting with "true" to enable our garage. This allows users to remove their vehicles from the garage. Afterwards, you can disable the garage system to give vehicles a designated position to stay.

3. Configuration

You can modify many aspects of our script according to your framework and some scripts you use.

All in the folder /editable

Explentation /editable/Config.lua

svConfig:

  • Framework: Specifies the framework being used (ESX, QBCORE, or CUSTOM).

  • Blip:

    • enabled: Indicates whether the GPS blip feature is enabled .

Depending on the framework specified, different configurations are set:

  • ColumnPropName: Name of the column storing vehicle properties.

  • ColumnOwnerName: Name of the column storing vehicle owner information.

  • ColumnPlateName: Name of the column storing vehicle plate information.

  • Tablename: Name of the table containing vehicle data.

clConfig:

  • vehiclespawnheading: Heading angle for vehicle spawning.

  • impoundcoords: Coordinates for impound location.

  • impoundHeading: Heading angle for impound location.

  • impoundGarageCamera: Coordinates and rotation for the impound garage camera.

  • vehiclespawncoords: Coordinates for vehicle spawn point.

  • impoundprice: Impound price.

  • currency: Currency symbol.

  • openmenukey: Key to open menu.

  • blip: Blip settings.

  • Locale: Localization strings for messages and notifications.

  • GarageEnable: Indicates whether the garage feature is (true/false) Check GARAGE section

  • EnableDeformation: If you want vehicle deformations to be saved, set it to true, but remember that this is a new beta setting. (Beta Version)

GarageLocale:

  • Localization strings for garage-related UI elements.

garagesConfig:

  • Configuration for our garages:

    • Title: Name of the garage.

    • MarkerCoords: Coordinates of the marker indicating the garage location.

    • CameraCoords: Coordinates and rotation for the garage camera.

    • SpawnCoords: Coordinates and heading for vehicle spawn point within the garage.

Explentation /editable/editclient.lua

Here you can modify the GetVehicleProperties and SetVehicleProperties functions according to the tuning script you use. Many scripts have custom functions for saving vehicle skins.

Explentation /editable/editserver.Lua

Here you can modify the GetIdentifier (xPlayer.identifier(), GetPlayerIdentifier(source, 0)) functions according to your framework, and the function that deducts money (xPlayer.getMoney(),PlayerData.money.cash) from the player.

Explentation /editable/notification.Lua

Here you can set your custom notifications. (ShowHelpNotification,ShowNotification)

4. Exports

CarLocking

To trigger the opening or closing of car doors within your car locking system, utilize the CarLocking export provided by this script. This export allows for seamless integration of car door operations into your existing vehicle management logic.

Usage:

  • plate: The license plate of the targeted vehicle.

  • bool: A boolean value indicating the desired action:

    • 2: Locks the car doors.

    • 1: Unlocks the car doors.

Integration Guide:

  1. Server-Side Implementation:

    • Ensure the export is placed within a Lua file executed on the server side of your FiveM resource or framework.

  2. Location in Car Locking Script:

    • Integrate the CarLocking export within the section of your car locking script responsible for managing vehicle interactions.

  3. Usage:

    • Call the CarLocking export whenever locking or unlocking car doors is required within your car locking script.

Example Usage:

By following these guidelines, you can seamlessly integrate the CarLocking export into your car locking script, enabling precise control over car door operations.


Gps

To toggle the visibility of the GPS on your vehicle, use the following export:

  • plate: The license plate of the targeted vehicle.

  • bool: A boolean value indicating the desired GPS state:

    • 0: GPS enabled.

    • 1: GPS disabled.

Integration Guide:

  1. Server-Side Implementation:

    • Ensure this export is placed within a Lua file executed on the server side of your FiveM resource or framework.

  2. Location in Script:

    • Integrate the GpsState export within your script's logic for managing vehicle features or GPS systems.

  3. Usage:

    • Call the GpsState export whenever you need to add or remove the GPS from a vehicle.

Example Usage:

By following these guidelines, you can seamlessly manage the visibility of GPS on your vehicles, enhancing the realism of your gameplay experience.


Impound

To trigger an impound from the client side of your police job or impound function, you can utilize the following export:

This export will trigger the impound action client-side.

Make sure to call this export from the appropriate location within your client-side script where you want the impound action to be triggered. This could be within a police job script or any other script responsible for impounding vehicles.

Example usage:


Vehicle Name

To change the name of vehicles displayed in garages and on the GPS, you can use the server-side export :

Here's how to do it:

You can call this function wherever necessary in your server-side Lua script to update the name of a vehicle in the garage and on the GPS. Make sure to provide the license plate (plate) and the new name (name) as arguments to the function.


Despawn Vehicle for Garage

To despawn vehicle in your custome garage use

You can call this function when you deposit the vehicle in your server-side Lua Garage Custom script, this function don't delete the vehicle only disable the auto respawn logic. Make sure to provide the license plate (plate)

Example in qb-garagesarrow-up-right MODIFIED:

Example in qb-garagesarrow-up-right ORIGINAL:

Example in esx_garagearrow-up-right MODIFIED:

Example in esx_garagearrow-up-right ORIGINAL


Spawn Vehicle for Garage

To spawn vehicle in your custome garage use

You can call this function when you retrieve the vehicle in your server-side Lua script for custom garages. This function spawns the vehicle without using different spawn logic. Ensure to provide the license plate (plate), coordinates (coord) as a Vector3, heading for spawn (heading), vehicle modifications (prop), and a task wrap (taskwrap) if you pass the player's source, which will automatically seat the player inside the vehicle.

Example in esx_garagearrow-up-right MODIFIED:

Example in esx_garagearrow-up-right ORIGINAL

Example in qb-garagesarrow-up-right MODIFIED:

Example in qb-garagesarrow-up-right ORIGINAL:

Last updated