qb-garages icon indicating copy to clipboard operation
qb-garages copied to clipboard

Errors caused by change of parameter order

Open mikepauer opened this issue 2 years ago • 0 comments

Because you changed the parameter order for the function that is saving the vehicle so it is different from qb-cores default. So anything written to call qb-cores is failing.

This is the current qb-core default: RegisterNetEvent('qb-garage:server:updateVehicle', function(state, fuel, engine, body, plate, garage, type, gang)

This is the one currently being used: RegisterNetEvent('qb-garage:server:updateVehicle', function(state, fuel, engine, body, properties, plate, garage, location, damage)

so anything hooking into it (or trying to call it) is expecting plate as parameter 5, while this and it's own parking call is passing properties as parameter 5, plate as parameter 6.

To fix this I changed the function declaration to RegisterNetEvent('qb-garage:server:updateVehicle', function(state, fuel, engine, body, plate, garage, location, gang, properties, damage)

And I updated the function call in the client script (line 298 approximately) to be: TriggerServerEvent('qb-garage:server:updateVehicle', 1, totalFuel, engineDamage, bodyDamage, plate, garageName, StoreParkinglotAccuratly and closestVec3 or nil, nil, properties, StoreDamageAccuratly and GetCarDamage(veh) or nil)

which makes it so the garage parking works, but also any other scripts that are hooking into it also work.

mikepauer avatar Sep 07 '22 20:09 mikepauer