Vehicle garage system

Script Installation Guide

Installing this package is very simple. Follow the steps below:

Step 1: Download

  • Download the script from your Keymaster.

Step 2: Extract

  • Extract the package locally.

Step 3: Upload

  • Upload the script to your server files.

Step 4: Configuration

This is a detailed garage system and requires setup before use.

  • Define jobs and ranks in the config that are allowed to perform raids or impound vehicles.

  • The impound system supports both police and DMV roles or any other.

    • Example: a parking violation infraction can involve both police and DMV.

    • Example: street racing infractions are restricted to police only.

  • The entire system is designed with roleplay immersion in mind:

    • No teleporting or “warping” into vehicles.

    • All actions are as immersive as possible.

Step 5: Keys Integration

  • If you are using a vehicle keys system, a bridge file is included to automatically give players keys when a vehicle is spawned.

  • If you are using our keys system, the bridge is already pre-installed. Simply enable it in the config.

Step 6: Exports

This script provides two exports for integration with other UI scripts:

  1. Store vehicle in the garage.

  2. Open retrieve menu (UI menu to select which vehicle to retrieve).

Requirements

  • ox_lib

  • ox_target

Make sure these dependencies are installed before running the script.

Useful commands for players:

garagerefreshblips - if script does not refresh blips correctly by it self, this forces blip refresh for the player, anyone can use it garagespots - all the parking spots has their vehicle siluette to check where the spot exactly is

Exports:

exports["ug_vehicle_garage_system"]:TriggerStoreVehicle() -- stores vehicle in front of you in the garage
exports["ug_vehicle_garage_system "]:TriggerRetrieveVehicle() -- retrieve vehicle UI when standing on the garage
exports['ug_vehicle_garage_system']:openGarageMarketUI() -- opens market UI for private garages market
exports['ug_vehicle_garage_system']:HasVehicleInDirection() -- boolean if vehicle is in front of you
exports['ug_vehicle_garage_system']:GetCurrentGarageZone() -- gets garage you are standing on

Required data base setup for script to work:

CREATE TABLE IF NOT EXISTS `garage_access` (
    `id` INT AUTO_INCREMENT PRIMARY KEY,
    `owner` VARCHAR(100) NOT NULL,
    `garage_id` VARCHAR(50) NOT NULL,
    `parking_id` INT DEFAULT NULL,
    `can_access` LONGTEXT DEFAULT NULL
);


ALTER TABLE `owned_vehicles`
  ADD COLUMN IF NOT EXISTS `garage` VARCHAR(50) DEFAULT `A`,
  ADD COLUMN IF NOT EXISTS `parking` VARCHAR(10) DEFAULT NULL;
  ADD COLUMN IF NOT EXISTS `stored` VARCHAR(1) DEFAULT NULL;
  ADD COLUMN IF NOT EXISTS `job` VARCHAR(50) DEFAULT NULL;
  ADD COLUMN IF NOT EXISTS `strikes` LONGTEXT DEFAULT NULL;
  ADD COLUMN IF NOT EXISTS `stolen` LONGTEXT DEFAULT NULL;
  ADD COLUMN IF NOT EXISTS `impounded` LONGTEXT DEFAULT NULL;
  ADD COLUMN IF NOT EXISTS `has_key` LONGTEXT DEFAULT NULL;

ALTER TABLE `player_vehicles`
  ADD COLUMN IF NOT EXISTS `garage` VARCHAR(50) DEFAULT `A`,
  ADD COLUMN IF NOT EXISTS `parking` VARCHAR(10) DEFAULT NULL;
  ADD COLUMN IF NOT EXISTS `stored` VARCHAR(1) DEFAULT NULL;
  ADD COLUMN IF NOT EXISTS `job` VARCHAR(50) DEFAULT NULL;
  ADD COLUMN IF NOT EXISTS `strikes` LONGTEXT DEFAULT NULL;
  ADD COLUMN IF NOT EXISTS `stolen` LONGTEXT DEFAULT NULL;
  ADD COLUMN IF NOT EXISTS `impounded` LONGTEXT DEFAULT NULL;
  ADD COLUMN IF NOT EXISTS `has_key` LONGTEXT DEFAULT NULL;

Last updated