#CW Gearbox not saving to garage

1 messages · Page 1 of 1 (latest)

grim socket
#

IM using jdev qb garage and no matter what i do the gearbox wont save

#

`RegisterNetEvent('qb-garages:client:TakeOutGarage', function(data, cb)
local garageType = data.type
local vehicleModel = data.vehicleModel
local vehicle = data.vehicle
local garage = data.garage
local spawnDistance = garage.SpawnDistance and garage.SpawnDistance or Config.SpawnDistance
local parkingSpots = garage.ParkingSpots or {}

local location, heading = GetSpawnLocationAndHeading(garage, garageType, parkingSpots, vehicle, spawnDistance)
if garage.useVehicleSpawner then
    SpawnVehicleSpawnerVehicle(vehicleModel, location, heading, cb)
else
    if Config.SpawnVehiclesServerside then
        QBCore.Functions.TriggerCallback('qb-garage:server:spawnvehicle', function(netId, properties)
            local veh = NetToVeh(netId)
            if not veh or not netId then
                print("ISSUE HERE: ", netId)
            end
            UpdateSpawnedVehicle(veh, vehicle, heading, garage, properties)
            if cb then cb(veh) end
        end, vehicle, location, garage.WarpPlayerIntoVehicle or Config.WarpPlayerIntoVehicle and garage.WarpPlayerIntoVehicle == nil)
        TriggerEvent("cw-tuning:client:handleTakeOutVehicle", veh)
    else
        QBCore.Functions.SpawnVehicle(vehicleModel, function(veh)
            QBCore.Functions.TriggerCallback('qb-garage:server:GetVehicleProperties', function(properties)
                UpdateSpawnedVehicle(veh, vehicle, heading, garage, properties)
                if cb then cb(veh) end
            end, vehicle.plate)
        end, location, true, garage.WarpPlayerIntoVehicle or Config.WarpPlayerIntoVehicle and garage.WarpPlayerIntoVehicle == nil)
    end
end

end)`

#

dont know where to put the event as mine is different to base qb

subtle mulch
#

is it only the gearbox that doesnt save?

#

Try setting WarpPlayerIntoVehicle to false.

Someone else reported the warp fucks up the tuning

grim socket
#

could we go in a vc and ill explain?

subtle mulch
#

I'm at work rn so can't really do vc.

Answer the first question also please

grim socket
#

the issue for me is i dont know where to put the event as my garage is different?

subtle mulch
#

Did you try different spots?

grim socket
#

yeah man cannot figure it out

subtle mulch
#

Enable debug for cw-tuning

grim socket
#

yeah everything seems fine?

subtle mulch
#

And enable it for gearbox also

#

It works when you add the transmission right? It just doesnt save?

grim socket
subtle mulch
#

And the vehicle has advanced flag in it's handling right?

grim socket
#

im using a gta vehicle no clue tbh its the dominator

subtle mulch
#

Try with a tuner car

grim socket
#

do u know any tuner cars spawn codes lol?

subtle mulch
#

zr350

#

I'm fairly certain that vanilla dominator does not have advanced flags. And as mentioned in the readme, the flag existing IS REQUIRED sadly

grim socket
#

yeah but the script works fine tho?

subtle mulch
#

That is certainly odd

#

haha

grim socket
#

allg bro no stress do u think later we could go in a vc?

subtle mulch
#

I mean I understand your problem, but a VC wont help if the issue is the placement of the EventTrigger, I don't know that garage script you use so I can't really help there 😅

subtle mulch
# grim socket

Are these prints from after you take a car out, or when you apply a part?

subtle mulch
grim socket
#

@subtle mulch

subtle mulch
#

Why is it fetching a plate with a nil plate?

grim socket
#

this is a new car

grim socket
subtle mulch
#

What if you put the event trigger at the end of the event you're calling? So just above the last end) in the code yous ent

grim socket
#

still nothing

#

what do i put for where it says vehicle

#

i put plate coz the code didnt have a local called veh

subtle mulch
#

It seems to be spawning the vehicle after calling the event? If your prints aren't in some weird order

grim socket
#

i hade it on plate before

subtle mulch
grim socket
#

true

subtle mulch
#

AH wait

#

I think I know

grim socket
#

please tell me u do

subtle mulch
#

it needs to be inside the callback

grim socket
#

QBCore.Functions.TriggerCallback('qb-garage:server:spawnvehicle', function(netId, properties)
local veh = NetToVeh(netId)
if not veh or not netId then
print("ISSUE HERE: ", netId)
end

subtle mulch
#

So put it after the UpdateSpawnedVehicle

grim socket
#

what one?

#

HOLY SHIT

#

IT WORKED

#

UR A LEGENED