qbcore-framework / qb-garages

Garage System Used With QB-Core :car:
GNU General Public License v3.0
48 stars 259 forks source link

Attempted to index a nil value (field 'putVehicle') #290

Closed Zack3267 closed 1 year ago

Zack3267 commented 1 year ago

Added a garage for the job lscs type leo. Every time I try to active it I get this error. Any idea what might be causing it?

qb-garages/client.lua line 489 is where the error is coming from the putVehicle code.

local sleep
while true do
    sleep = 2000
    if currentGarage ~= nil then
        if Markers then
            DrawMarker(2, currentGarage.putVehicle.x, currentGarage.putVehicle.y, currentGarage.putVehicle.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.3, 0.2, 0.15, 255, 255, 255, 255, false, false, false, true, false, false, false)
            DrawMarker(2, currentGarage.takeVehicle.x, currentGarage.takeVehicle.y, currentGarage.takeVehicle.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.3, 0.2, 0.15, 200, 0, 0, 222, false, false, false, true, false, false, false)
            sleep = 0
        elseif HouseMarkers then
            DrawMarker(2, currentGarage.takeVehicle.x, currentGarage.takeVehicle.y, currentGarage.takeVehicle.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.3, 0.2, 0.15, 200, 0, 0, 222, false, false, false, true, false, false, false)
            sleep = 0
        end

Here in the config is the garage I added for the area having the issue. -- LEO Department Garages ["lscs"] = { ["label"] = "LSCS Department Garage", ["takeVehicle"] = vector3(388.7, -1613.29, 29.29), ["spawnPoint"] = vector4(386.98, -1623.36, 29.29, 340.7), ["putVehicle"] = vector3(391.01, -1610.48, 29.29), ["showBlip"] = false, ["blipName"] = "LSCS Department Garage", ["blipNumber"] = 357, ["blipColor"] = 2, ["type"] = "job", --public, job, gang, depot ["job"] = "lscs", ["jobType"] = "leo", ["vehicle"] = "car" --car, air, sea, rig },

PLEASE HELP!!

Zack3267 commented 1 year ago

The most frustrating bug ever. Please help!