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
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.
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 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.
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
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.
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!