RH-Garage [QB/ESX/vRP]

RH-Garage By RH-Store available in [QBCore]


[Preview]

Preview


Download (18€)

Get this resource at Tebex


[Explanation]

This is a Garage script with a elegant and user-friendly UI.
It contains Garage for: car, boat and aircrafts. Job Garages & Impound


[Interface]


Looks better in the video – Screenshots where taken from a HTML view so I just removed green bg


[How it works]

Configure the config file and client utils file to your needs
Go to one of the specified Garages to open the Garage
A UI will pop up with a list of every car the player own
2 buttons are beneath every vehicle. A nickname and show button
The nickname button will open a UI that allows the player to give the specific vehicle a nickname
The nicknames are automatically saved in the database
If the field is left empty it will remove any nickname assigned to the vehicle
The show button will open yet another UI where the player gets info about the desired vehicle
It will display the vehicle plate, name, max speed, engine health, body health and fuel health
In the bottom there will be a “Select” button that spawns the vehicle and let you drive around


[Optimization]

This script is fully optimized.

  • Idle: 0.00ms;
  • Marker: 0.03ms;
  • UI Open: 0.00ms;

[FiveM Asset Escrow System]

This script is using the Asset Escrow system.


[Config]

Config = {}
Config.FrameWork = 'qb' -- esx -- qb -- vrp
Config.FrameWorkObject = {} -- !!DONT CHANGE ANYTHING HERE IF YOU DON'T KNWO TAHT YOU ARE DOING!!
Config.FrameWorkObject.ESX = 'esx:getSharedObject'
Config.FrameWorkObject.QB = 'qb-core'
Config.FrameWorkObject.vRP = {}
Config.FrameWorkObject.vRP.Module = 'vrp'
Config.FrameWorkObject.vRP.Interface = 'vRP'
Config.Locale = "en"
Config.QBPlayer_Boats = false -- If you have a player_boats table in your database or not
Config.ESXDBAirTypeName = 'air' -- Under your owned_vehicles table find the "type" and write the type name for aircrafts here
Config.vRPDBAirTypeName = 'air' -- Under your vrp_user_vehicles table find the "type" and write the type name for aircrafts here
Config.TextSystem = true -- true = on (check cl_utils.lua) false = draw3d text
Config.Prefix = {}
Config.Prefix.DrawText = "[E] " -- Remember space after
Config.Prefix.Draw3D = "~m~[~r~E~m~]~w~ - " -- Remember space after
Config.CurrencyInfront = true -- if currency is in front or behind number ex. true = "$20" -- false = "20$"
Config.LockGarage = true -- Car only available in specific garage
Config.LeaveCarAnim = true -- True = Make player leave car before despawning -- False = despawning straight away
Config.KMH = true -- True = KM/H -- False = MPH
Config.ShowImpoundedVehicles = true -- Show impounded vehicles in normal garage
Config.ShowUnauthorizedJobVehicles = true -- Show job vehicles players don't have access to
Config.FixVehicleWhenParked = false -- Fix vehicles when you park them
Config.FuelVehicleWhenParked = false -- Set fuel level to max when you park
Config.FixVehicleWhenImpound = false -- Fix vehicles when vehicle is impounded
Config.FuelVehicleWhenImpound = false -- Set fuel level to max when vehicle is impounded
Config.PreferredMoneyType = 'bank' -- Wich moneytype should be taken when paying for impound -- vRP uses tryFullPayment (Just cash or if needed then cash+bank or just bank)
Config.ImpoundPrice = 500
Config.VehicleTypes = {} -- Specifies the distance before TextSystem is being shown
Config.VehicleTypes.car = 1.5
Config.VehicleTypes.boat = 5
Config.VehicleTypes.air = 7.5
Config.Marker = {}
Config.Marker.Type = {}
Config.Marker.Type.TakeOut = 21
Config.Marker.Type.Park = 21
Config.Marker.Data = {
    Size = {
        X = 0.4, -- X Scale
        Y = 0.4, -- Y Scale
        Z = 0.4, -- Z Scale
    },
    Color = {
        R = 255, -- Red
        G = 0, -- Green
        B = 0, -- Blue
        A = 50, -- Transperancy 100 = 100% visible -- 50 means 50% visible
    }
}
Config.Blips = {}
Config.Blips.Show = true -- General Config to turn all blips on/off
Config.Blips.Scale = 0.6
Config.Blips.Color = {} -- Get different color from here: https://docs.fivem.net/docs/game-references/blips/#blip-colors
Config.Blips.Color.Garage = 3
Config.Blips.Color.Impound = 1
Config.Blips.DifName = false -- True = Different blip names (Takes from Config.Garages.Name)
Config.Blips.Name = {} -- Only work when Config.Blips.DifName is false else it takes from Config.Garages.Name
Config.Blips.Name.Garage = "Garage"
Config.Blips.Name.Impound = "Impound"
Config.Impounds = {
    {
        ImpoundType = "car", --car, boat, air
        Name = "Impound Olympic Freeway",
        BlipOn = true,
        BlipID = 50,
        TakeOutLocation = vector3(485.93908691406,-1309.7138671875,29.258214950562),
        SpawnLocation = vector4(488.88064575195,-1314.4757080078,29.2581615448,272.23590087891),
        CamLocation = vector4(490.54342651367,-1306.4699707031,31.083597183228,180.71643066406),
    },
}
Config.Garages = {
    {
        GarageType = "car", --car, boat, air
        Name = "Garage Legion Square",
        BlipOn = true,
        BlipID = 357,
        TakeOutLocation = vector3(213.93919372559,-808.63909912109,31.014894485474),
        SpawnLocation = vector4(218.72137451172,-809.39630126953,30.689878463745,180),
        ParkLocation = vector3(212.97859191895,-797.00885009766,30.863006591797),
        CamLocation = vector4(215.10981750488,-812.74786376953,32.862442016602,304.2421875),
    },
    {
        GarageType = "air", --car, boat, air
        Name = "Garage Vespucci Helipad",
        BlipOn = true,
        BlipID = 64,
        TakeOutLocation = vector3(-693.33, -1453.53, 5.0),
        SpawnLocation = vector4(-700.44, -1447.71, 5.0, 43.75),
        ParkLocation = vector3(-724.7, -1444.04, 5.0),
        CamLocation = vector4(-704.07, -1455.47, 7.66, 336.31),
    },
    {
        GarageType = "boat", --car, boat, air
        Name = "Garage Del Perro Pier",
        BlipOn = true,
        BlipID = 427,
        TakeOutLocation = vector3(-1622.23, -1167.83, 1.81),
        SpawnLocation = vector4(-1620.93, -1176.46, 0.65, 121.0),
        ParkLocation = vector3(-1634.32, -1156.8, 1.22),
        CamLocation = vector4(-1618.63, -1185.73, 7.75, 15.82),
    },
}
Config.JobGarages = {
    {
        Job = {"Politi-Job" --[[,"ambulance", "mehcanic"]]}, -- Job/Group to open garage
        Name = "MRPD Garage",
        BlipOn = true,
        BlipID = 60,
        BlipColor = 3,
        TakeOutLocation = vector3(455.9248046875,-1014.2160644531,28.430242538452),
        SpawnLocation = vector4(446.18087768555,-1026.3280029297,28.647802352905,358.12893676758),
        ParkLocation = vector3(452.59622192383,-1020.8623046875,28.350873947144),
        CamLocation = vector4(452.85012817383,-1020.2408447266,29.588802337646,129.94825744629),
        Vehicles = {
            {
                Displayname = "Police CAC",
                Model = "police3",
                Grade = {0,1,2,3,4,5,6,7}, -- If vRP then jsut write a group name here
                Plate = "7JKL666"
            },
            {
                Displayname = "Police CAC2",
                Model = "police3",
                Grade = {1,2,3,4,5,6,7},
                Plate = "7JKL666"
            },
        },
    },
}

Other Scripts By Me

RH-MoneyWash [ESX][QBCore][vRP]
RH-DrugSystem [QBCore/ESX/vRP]

Code is accessible No
Subscription-based No
Lines (approximately) 2000+
Requirements Framework
Support Yes
1 Like

Incredible work! Keep it up! A++++

1 Like

Thx mate!

hi,

i just downloaded the garage script but when i try to open the impound i get this error:

[ script:oxmysql] SCRIPT ERROR in promise (unhandled rejection): Error: rh-garage was unable to execute a query!
[ script:oxmysql] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘stored = 0 AND type = ‘car’’ at line 1
[ script:oxmysql] SELECT * FROM owned_vehicles WHERE owner = ? AND stored = 0 AND type = ? [“char1:b49164b7013028bb6fa575db58180ce3520dcd8b”,“car”]
[ script:oxmysql] > (@oxmysql/dist/build.js:22257)
[ script:oxmysql] > processTicksAndRejections (node:internal/process/task_queues:96)
[ script:oxmysql] > async rawQuery (@oxmysql/dist/build.js:22224)

Any idea about how to fix it?

[ script:rh-garage] SCRIPT ERROR: @rh-garage/server/sv_utils.lua:18: attempt to index a nil value (global ‘MySQL’)
[ script:rh-garage] > TriggerServerCallback (@es_extended/server/functions.lua:160)
[ script:rh-garage] > handler (@es_extended/server/common.lua:71)
[ script:es_extended] SCRIPT ERROR: error object is not a string

When I try to open the UI, I cannot open the UI, and I am prompted that the above information is wrong. My English is not good, and it may cause errors in your reading, so I won’t say anything anymore.
My ESX version is 1.2.How can I get it to work.

Open a ticket on and I will be able to give you much better support than over this forum :slight_smile:

EMM, I’m sorry to bother you. I have solved this problem. I changed ‘@ oxmysql/lib/MySQL. lua’ to ‘@ mysql-async/lib/MySQL. lua’, and then the problem was solved. Glad to hear from you. This is a very good script, thank you.

Perfect, glad you figured it out and like the script!

Whether it is open source or not

This version, not open source :slight_smile:

Is there an open source version?

Not at the moment, no.
What do you need configured?

ESX open source version

There is a problem with the script, why is no one handling it