[ESX] [FREE] [RELEASE] Easy Garage system

Easy Garage system for ESX

A simple garage script. Each vehicle will be stored in the database. Simple adjustment.


Download from github

v1.3
Fixed some little bugs.
Added more garages.

v1.2
Fixed a bug that made it impossible to buy a garage from a car and return an error.

v1.1
Now it is possible to set the garage as public or private and buy it.
You can also set a limit of vehicles in the garage.
In the next version, it will be possible to lock the garage.

v1.0
In the client.lua you can add new garages or edit existing ones.
It is possible to connect several entrances to one garage.
You can turn off/on blips and markers for each garage.
You can set up a garage for a specific job.

Install:
Download script from github and upload to resources.
in server.cfg write the name of the script.
in client.lua you can edit all garages.
Import table.sql to your database.

Edit garages
{name = "lspd1", pos = vector3(463.5, -1015.2, 28.07), label = "LSPD", heading = 88.89, job = "police", marker = 36, showMarker = true, color = {r = 0, g = 0, b = 255}, blip = true, public = 1, price = 0, limit = 0}
name - The name of the garage in the database - If you want more entrances to one garage, just enter the same name.
pos - Garage position
label - The displayed name of the garage
heading - Spawn heading
job - If the garage is public or for sale write job="". If you want the garage to be for specific job only, write the name of the job.
marker - Marker type (1 = cylinder, 20 = arrow, 21 = double arrow, 22 = triple arrow, 33 = plane, 34 = helicopter, 35 = boat, 36 = car, 37 = motorcycle, 38 = bike, 39 = tir…) All markers here
showMarker - If marker is visible
color = set RGB of marker
blip = If blip is visible
public = If the garage is public or not - 1 public, 0 for sale
price = Price of the garage if public is 0 (Garage is for sale)
limit = Max vehicles in one garage (0 = unlimited)

Try also Towing service job

3 Likes

The new version is available for download. I will be happy for your feedback and possible advice on how to improve. :slightly_smiling_face:

[script:nescio_garage] SCRIPT ERROR: @nescio_garage/server.lua:87: attempt to index a nil value (field ‘?’)
[script:nescio_garage] > ref (@nescio_garage/server.lua:87)
[script:nescio_garage] > (@mysql-async/mysql-async.js:15543)

when I try to get the car out of the garage…

Please try the latest version (1.3), it should fix it. Plus more galley garages are added. And let me know if it works for you too.

[script:nescio_garage] SCRIPT ERROR: @nescio_garage/server.lua:105: attempt to index a nil value (field ‘?’)
[script:nescio_garage] > ref (@nescio_garage/server.lua:105)
[script:nescio_garage] > (@mysql-async/mysql-async.js:15543)
[ script:mysql-async]

same problem even if I change the string

–if #vehs == limit then
– cb(false)
–else
– cb(true)
–end

Ok, remove this from client.lua
line 309-313

ESX.TriggerServerCallback("nescio-garage:islocked", function(IsGarageLocked1)
        if IsGarageLocked1 == false then
            IsGarageLocked = 0
        end
    end, garageName)

This feature isn’t live yet, but I’m surprised it’s blocking you like this. If you remove it, it might solve the problem.

After installing the car in the garage, I can’t pick it up - the garage is empty