JonasDev17 / qb-garages

GNU General Public License v3.0
96 stars 70 forks source link

Errors caused by change of parameter order #70

Closed mikepauer closed 1 year ago

mikepauer commented 1 year ago

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.

JonasDev17 commented 1 year ago

Thank you, I changed it!