[Release] [ESX] [Garage]

Hello mates,
I am configuring an ESX server and I am adding module to module without problems. However, when adding the garage module, I get this error in the console when entering the instance:

Error running call reference function for resource esx_garage: citizen:/scripting/lua/scheduler.lua:351: server/main.lua:93: attempt to index a nil value (local 'xPlayer')
stack traceback:
        server/main.lua:93: in upvalue 'ref'
        citizen:/scripting/lua/scheduler.lua:337: in function <citizen:/scripting/lua/scheduler.lua:336>
        [C]: in function 'xpcall'
        citizen:/scripting/lua/scheduler.lua:336: in function <citizen:/scripting/lua/scheduler.lua:335>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:351: in function <citizen:/scripting/lua/scheduler.lua:322>
Error running system event handling function for resource es_extended: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: citizen:/scripting/lua/MessagePack.lua:830: missing bytes
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/MessagePack.lua:830: in method 'underflow'
        citizen:/scripting/lua/MessagePack.lua:465: in field 'any'
        citizen:/scripting/lua/MessagePack.lua:860: in field 'unpack'
        citizen:/scripting/lua/scheduler.lua:563: in field '?'
        server/functions.lua:60: in field 'TriggerServerCallback'
        server/common.lua:74: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:175: in function <citizen:/scripting/lua/scheduler.lua:174>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:174: in function <citizen:/scripting/lua/scheduler.lua:138>

The cars are not getting saved inside either.
Iā€™m using: fxserver (build 20-feb-2018), essentialmode5 with es_admin2 and esplugin_mysql + ESX base and official plugins I have downloaded from github a few days ago (all updated)

Does anyone know what can it be? Every help is welcome! :heart_eyes:
Thanks

PS: Sorry my english!

Hello mates!
I ended up solving my problem by changing all of the following lines from the server/main.lua file from:

local _source = _source

to

local _source = source

I made the change request in github so that it can be fixed if other people are experiencing this problem.
And I want to thank you for this beautiful work!

Is it possible to create public garages without using instances? Thank you!

2 Likes

the cars disappear in my garage. What do I do?

Have you installed the resource ā€œInstanceā€? Did you start it before esx_garage on server.cfg?

Have you recently downloaded the resource in github? Because a new commit was made with changes to fix problems that generated this type of error 12 days ago.

What do I do?

How do I add more garages?

can any one help me with this plz ā€¦

So I have this sytem and Iā€™ve added custom new garages ectā€¦ as well but I am currently trying to get a instance system in place for them to be able to visit others garages like the esx_properties system anyone else try this previously? and if so have you had it possible

Hi guys,

Running ESX latest version etc etcā€¦

Trying to add a couple garages with the ESX Garage script without luckā€¦

I can enter like a second config including the marks and all for the garage, but then the system just randomly teleports you out of the garage to the outside spawn of another garage like some crazy russian rouletteā€¦

anyone know why this is happening?

Thanks

1 Like

I have added a dock to my garages to store boats. Everything works except it says you cannot store this type of vehicle. Any ideas on how to fix this?

Hey, I have trouble adding another garage. Can you show me your config. Lua, I think I missed something. Ty

Hi,

i canā€™t help you with that YET,

Iā€™m seeking the answer as we speak so it shouldnā€™t take long to get back to you on that.

Check other scripts that store other stuff like the plane hangar to see how they ā€œdefinedā€ the object to match it a plane in this case

1 Like

Hi!

Very nice script, just on my server, there is problem with saving cars. Everytime I go in or out, carā€™s randomised. Itā€™s saved even when server is restarted, but different livery etc. everytime.

Any idea?

EDIT.: Well, it looks like a problem just for Windsor and livery setupā€¦

same here, itā€™s in my database but then itā€™s gone after reset.
The point of a database is that it will have the car saved in the garage foreverā€¦

have u instance script installed.

I noticed the instance wasnā€™t in my cfg so ofc it didnā€™t run it. I rebooted the server and the car still got removed from the database automatically after i closed the server but after another restart, it worked out great and even after a server restart, the cars saved. But thanks for the help

you can add stolen vehicles, even add ons

thanks my dear, but i found out and made my own garage :wink: