Giter Site home page Giter Site logo

bgarage's Introduction

bGarage

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.

Features

  • 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

Installation

Dependencies

This resource requires the following to function correctly:

Setup

  1. Download the source code using the green Code button or the latest release from here.
  2. Unpack the contents of bGarage-main.zip or bGarage.zip file into a newly created folder named bGarage.
  3. Place the bGarage folder into your resources directory.
  4. Execute the queries found in sql/install.sql in your database.
  5. Add start bGarage to the location where your resources are initialized.
  6. Be sure to adjust the files found in the config directory to fit your needs.

Usage

Commands

/v buy (alias: /vb)

  • 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.

/v park (alias: /vp)

  • Executing this command will safely park your vehicle, placing it in your vehicle garage and designating its status as 'parked'.

/v list (alias: /vl, /vg)

  • 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.

/v impound (optional) (alias: /vi)

  • 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 to false. If you opt to set shared.impound.static as false, 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 at shared.impound.location).

/v stats (alias: /vs)

  • 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.

/impound

  • 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.

/admincar

  • 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.

/givevehicle [playerId] [model]

  • 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.

/deletevehicle [playerId] [plate]

  • 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.

Exported Functions (server)

addVehicle

  • Add a vehicle to the system.

Example:

exports.bGarage:addVehicle(owner, plate, model, props, type, location, fuel, body, engine, temporary)

Types:

  • owner

    • number or string
      • Number is for Ox, string is for ESX. For Ox, it is player.charId, for ESX, it is player.license (if you're using ESX Multicharacter, the license will be char1:etc and will be unique along characters).
  • plate

    • string
      • The plate the vehicle holds.
  • model

    • number or string
      • 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 or ESX.Game.GetVehicleProperties.
  • 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.
  • body (optional)

    • number
      • The body health of the vehicle, can be obtained using client functions like GetVehicleBodyHealth.
  • engine (optional)

    • number
      • The engine health of the vehicle, can be obtained using client functions like GetVehicleEngineHealth.
  • 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.

removeVehicle

  • 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.

getVehicle

  • Get a vehicle from the system.

Example:

exports.bGarage:getVehicle(plate)

Types:

  • plate
    • string
      • The plate the vehicle holds.

Return:

  • table
    • The vehicle data.

getVehicleOwner

  • 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.

getVehicles

  • Get all vehicles from an owner with an optional location filter.

Example:

exports.bGarage:getVehicles(owner, location)

Types:

  • owner

    • number or string
      • Number is for Ox, string is for ESX. For Ox, it is player.charId, for ESX, it is player.license (if you're using ESX Multicharacter, the license will be char1:etc and will be unique along characters).
  • 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.

setVehicleStatus

  • Set the status of a vehicle.

Example:

exports.bGarage:setVehicleStatus(owner, plate, status, props, fuel, body, engine)

Types:

  • owner

    • number or string
      • Number is for Ox, string is for ESX. For Ox, it is player.charId, for ESX, it is player.license (if you're using ESX Multicharacter, the license will be char1:etc and will be unique along characters).
  • 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 or ESX.Game.GetVehicleProperties.
  • fuel (optional)

    • number
      • The fuel level of the vehicle, can be obtained using client functions like GetVehicleFuelLevel.
  • body (optional)

    • number
      • The body health of the vehicle, can be obtained using client functions like GetVehicleBodyHealth.
  • engine (optional)

    • number
      • The engine health of the vehicle, can be obtained using client functions like GetVehicleEngineHealth.

Return:

  • boolean

    • Whether it was successful or not.
  • string

    • The notification message letting you know if it was successful or not.

getRandomPlate

  • Generate a random plate according to the pattern in the config.

Example:

exports.bGarage:getRandomPlate()

Return:

  • string
    • The generated plate.

saveData

  • Force a save of all vehicles and parking spots to the database.

Example:

exports.bGarage:saveData()

Credits

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

bgarage's People

Contributors

bebomusa avatar vipexv avatar berkiebb avatar

Stargazers

 avatar ND0P avatar Pattarapon Koomphon avatar Geo avatar Anne Thorpe avatar  avatar  avatar Lua Logic avatar toby avatar  avatar Dave Lowe avatar Plomyk avatar Madsen avatar Yamada Taro avatar  avatar  avatar Dougie avatar Yeti avatar  avatar  avatar  avatar  avatar

Watchers

 avatar Lua Logic avatar  avatar  avatar  avatar

bgarage's Issues

Framework

Implement a comprehensive "standalone" bridge option.

This option should be crafted to determine the ownership status of vehicles by utilizing the license2 identifier. The primary objective of this integration is to eliminate the requirement for any external frameworks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.