HELP esx_vehicleshop menu issue

I’m not sure how long this has been broken on my server as it used to work just fine.
Here is the error:

Error resuming coroutine: client/main.lua:72: bad argument #1 to ‘insert’ (table expected, got nil)
stack traceback:
[C]: in function ‘table.insert’
client/main.lua:72: in function ‘OpenShopMenu’
client/main.lua:959: in function <client/main.lua:948>

The code snippets:
client/main.lua:71-73

71.  for i=1, #Vehicles, 1 do
72.    table.insert(vehiclesByCategory[Vehicles[i].category], Vehicles[i])
73.  end

client/main.lua:948-960

948. Citizen.CreateThread(function ()
949.   while true do
950.     Citizen.Wait(0)
951. 
952.     if CurrentAction ~= nil then
953.       SetTextComponentFormat('STRING')
954.       AddTextComponentString(CurrentActionMsg)
955.       DisplayHelpTextFromStringLabel(0, 0, 1, -1)
956. 
957.       if IsControlPressed(0, Keys['E']) and (GetGameTimer() - GUI.Time) > 300 then
958.         if CurrentAction == 'shop_menu' then
959.           OpenShopMenu()
960.         end

I have not made any edits to the script, tried reinstalling with all other mods removed with the same thing happening.

PS. To the moderator who closed my original post, please check for original resources post before telling people to post in them when they do not exist… thanks

3 Likes

Did you import the SQL file?

1 Like

Yes even reinstalled it all

2 Likes

I’m having the issue where people can not buy vehicles when there is not a dealer online

1 Like

Try this, edit the config.lua and set Config.EnablePlayerManagement = false
I’m not sure how this effects the dealer though.

2 Likes

Thanks. Yeah it makes it where you can’t have the dealer job pretty much but that’s okay for now. Do you run esx_garage? I can’t seem to park my cars and was seeing if you have had the same issues. I hate the one garage.

Yes I use esx_garage and also hate just having the one place to put cars. I have no issues with it though.

I found another garage that works better to me and it is way easier to add more garages. Esx_eden_garage with pound I think you would like it. It comes with two garages

Thank you I’ll give that a try.
I’m still looking for a solution to my esx_vehicleshop problem, it’s almost as though it doesn’t see the DB but doesn’t throw out any MySQL errors.

I have the same error, i dont find solution…

hey boys. Config.EnablePlayerManagement = false ok, but users font buy a car. and now?

I tried this and it still doesn’t help, I get stuck where the car should spawn but nothing spawns and no menu of the cars appears.
Still trying to figure this out but may just remove it, it ‘did’ work so I don’t know what happened.

5 Likes

Im having this issue and i’ve been trying to fix it for the past week, has anyone found a solution?

Did you ever find a fix for this? I am going crazy.

1 Like

I have the same issue and I can’t find nowhere any solution, please help me

1 Like

Same issue…

2 Likes

i have been banging my head against the wall i think fivem has broken esx again !! no matter what i do as soon as i iinput addon cars in the db no menu froze in middle of dealership and i have tryed everything last error was esx society but i have reinstalled that over and over

1 Like

Im now having the same problem. it worked fine about 3 hours ago. but I did add some addon vehicles. then when I went to test them the menus for the cars,planes and boat shops wont load. but I don’t get any errors. anyone found a fix yet I would really appreciate the help. don’t see why it wont work though I already had addon vehicles on there working fine.

3 Likes

Just to let people know since the solution hasn’t been posted, the error everyone here is getting is due to setting the category to a non-default one. When adding an addon car to the vehicle shop pick one of the standard categories and all is good!

2 Likes

Do you find the solution?

1 Like