The primary goal of this advanced vehicle parking system is to imbue a sense of realism while efficiently managing owned vehicles. Developed with the intention of transitioning towards a more universal and adaptable structure. Essentially, this system offers users the flexibility to access information about their owned vehicles and retrieve them from any location they desire.
If you've had the chance to experience SA:MP (San Andreas Multiplayer) or GTA:W (GTA World) on the RAGEMP platform, you'll likely recognize the mechanics and features of this system. Its arrival on the FiveM platform comes as a response to high demand, hopefully fulfilling the wishes of many within the community.
- Conveniently store and retrieve your owned vehicles from a location of your choosing via commands, enhancing the realism of your experience.
- Identify whether you own a vehicle or not.
- While the flexibility of accessing your vehicles from any location is undoubtedly a plus, it's worth noting that once your vehicle is impounded, the retrieval process becomes constrained to a fixed and static impound lot location unless configured otherwise.
- Support is extended to aircraft and boats, each equipped with facilities that cater to storage and retrieval.
- Includes a tracking system for players to locate their vehicles easily, either within their garage, on the map, or at the impound lot.
- Possess an excess number of vehicles? Choose to permanently remove vehicles from your storage at any given time. Note that this action cannot be reversed.
- The process of spawning vehicles is primarily handled on the server side, utilizing the non-RPC native
CreateVehicleServerSetter
. - Logs for specific actions are handled by ox_lib's logger module, Discord is no longer supported.
- Any framework support, ox_core, es_extended, and qb-core are integrated by default.
- The interface is handled via ox_lib's interface module, which has replaced the former React + Mantine interface. This new interface is implemented in Lua, chosen for its wider accessibility and ease of contribution, ensuring broader engagement from users.
2024-04-06.02-09-18.mp4
2024-04-06.02-09-44.mp4
This resource requires the following to function correctly:
- oxmysql
- ox_lib
- ox_inventory (if you're using ox_core)
- Download the source code using the green
Code
button or the latest release from here. - Unpack the contents of
bGarage-main.zip
orbGarage.zip
file into a newly created folder namedbGarage
. - Place the
bGarage
folder into yourresources
directory. - Execute the queries found in
sql/install.sql
in your database. - Add
start bGarage
to the location where your resources are initialized. - Be sure to adjust the files found in the
config
directory to fit your needs.
- Use this command to acquire a parking spot location. You can use this command from any location, and each time it is executed, you will secure ownership of a parking spot at that specific location.
- Executing this command will safely park your vehicle, placing it in your vehicle garage and designating its status as 'parked'.
- This interface provides an in-depth overview, displaying a list of your owned vehicles along with their status, and offers an option to track them. Choosing a vehicle from this list will cause it to reappear at the location where you initiated the
/v buy
command. It's crucial to note that this feature does not permit the removal of vehicles in the 'impound' state by default; instead, it prompts you to retrieve such vehicles from the designated static impound location unless configured differently.
- An extra interface that presents a list of all owned vehicles currently impounded (identical to the interface shown when configured to a static location). This command operates exclusively when
shared.impound.static
is set tofalse
. If you opt to setshared.impound.static
asfalse
, selecting a vehicle from this list will cause it to spawn at the location where you executed/v buy
, rather than the general location of the vehicle impound (the vector4 defined atshared.impound.location
).
- This feature provides an extensive overview of the current vehicle specifications, encompassing its class, transmission level, braking system, suspension setup, turbo configuration, and other relevant details, allowing for a comprehensive understanding of the vehicle capabilities and components.
- This command is restricted to certain job roles and is used for moving vehicles to the impound lot, where they are placed in the 'impound' state. You can modify
shared.impound.command
to adjust this command according to your requirements.
By default, this command serves as the standard method for impounding vehicles. If you happen to be utilizing ox_target, an additional option is available, allowing you to impound vehicles using the target eye.
- A command restricted to a specific group, intended to save the current vehicle you are seated in to both the database and your personal vehicle garage.
- Another command limited to a particular group and is tailored to simplify the process of adding vehicles to both the database and the vehicle garages of other players.
- Similar to the command above, this one also remains restricted to a specific group and aims to streamline the procedure of removing vehicles from both the database and the vehicle garages of other players.
- Add a vehicle to the system.
Example:
exports.bGarage:addVehicle(owner, plate, model, props, type, location, fuel, body, engine, temporary)
Types:
-
owner
number
orstring
- Number is for Ox, string is for ESX. For Ox, it is
player.charId
, for ESX, it isplayer.license
(if you're using ESX Multicharacter, the license will be char1:etc and will be unique along characters).
- Number is for Ox, string is for ESX. For Ox, it is
-
plate
string
- The plate the vehicle holds.
-
model
number
orstring
- The model name or hash of the vehicle.
-
props (optional)
table
- The properties of the vehicle (e.g., vehicle color, tints, etc.) can be obtained using client functions like
lib.getVehicleProperties
orESX.Game.GetVehicleProperties
.
- The properties of the vehicle (e.g., vehicle color, tints, etc.) can be obtained using client functions like
-
type (optional)
string
- The type of vehicle.
-
location (optional)
'outside'
or'parked'
or'impound'
, default state is'outside'
.- The state to place the vehicle at, without affecting the physical location of the vehicle.
-
fuel (optional)
number
- The fuel level of the vehicle, can be obtained using client functions like
GetVehicleFuelLevel
.
- The fuel level of the vehicle, can be obtained using client functions like
-
body (optional)
number
- The body health of the vehicle, can be obtained using client functions like
GetVehicleBodyHealth
.
- The body health of the vehicle, can be obtained using client functions like
-
engine (optional)
number
- The engine health of the vehicle, can be obtained using client functions like
GetVehicleEngineHealth
.
- The engine health of the vehicle, can be obtained using client functions like
-
temporary (optional)
boolean
- If the vehicle should be temporary or not. If 'temporary', it won't be saved to the database.
Return:
boolean
- Whether it was successful or not.
- Remove a vehicle from the system.
Example:
exports.bGarage:removeVehicle(plate)
Types:
- plate
string
- The plate the vehicle holds.
Return:
boolean
- Whether it was successful or not.
- Get a vehicle from the system.
Example:
exports.bGarage:getVehicle(plate)
Types:
- plate
string
- The plate the vehicle holds.
Return:
table
- The vehicle data.
- Get a vehicle from the system by its owner.
Example:
exports.bGarage:getVehicleOwner(source, plate)
Types:
-
source
number
- The source of the player to get the vehicle from.
-
plate
string
- The plate the vehicle holds.
Return:
table
- The vehicle data.
- Get all vehicles from an owner with an optional location filter.
Example:
exports.bGarage:getVehicles(owner, location)
Types:
-
owner
number
orstring
- Number is for Ox, string is for ESX. For Ox, it is
player.charId
, for ESX, it isplayer.license
(if you're using ESX Multicharacter, the license will be char1:etc and will be unique along characters).
- Number is for Ox, string is for ESX. For Ox, it is
-
location (optional)
'outside'
or'parked'
or'impound'
- The state to place the vehicle at, these don't impact the physical location of the vehicle.
Return:
table
- An array holding vehicle data.
- Set the status of a vehicle.
Example:
exports.bGarage:setVehicleStatus(owner, plate, status, props, fuel, body, engine)
Types:
-
owner
number
orstring
- Number is for Ox, string is for ESX. For Ox, it is
player.charId
, for ESX, it isplayer.license
(if you're using ESX Multicharacter, the license will be char1:etc and will be unique along characters).
- Number is for Ox, string is for ESX. For Ox, it is
-
plate
string
- The plate the vehicle holds.
-
status
'parked'
or'impound'
- The state the vehicle should be placed under, without impacting its physical state.
-
props (optional)
table
- The properties of the vehicle (e.g., vehicle color, tints, etc.) can be obtained using client functions like
lib.getVehicleProperties
orESX.Game.GetVehicleProperties
.
- The properties of the vehicle (e.g., vehicle color, tints, etc.) can be obtained using client functions like
-
fuel (optional)
number
- The fuel level of the vehicle, can be obtained using client functions like
GetVehicleFuelLevel
.
- The fuel level of the vehicle, can be obtained using client functions like
-
body (optional)
number
- The body health of the vehicle, can be obtained using client functions like
GetVehicleBodyHealth
.
- The body health of the vehicle, can be obtained using client functions like
-
engine (optional)
number
- The engine health of the vehicle, can be obtained using client functions like
GetVehicleEngineHealth
.
- The engine health of the vehicle, can be obtained using client functions like
Return:
-
boolean
- Whether it was successful or not.
-
string
- The notification message letting you know if it was successful or not.
- Generate a random plate according to the pattern in the config.
Example:
exports.bGarage:getRandomPlate()
Return:
string
- The generated plate.
- Force a save of all vehicles and parking spots to the database.
Example:
exports.bGarage:saveData()
- BerkieB originally made this resource. I wanted it publicly available, so here it is.