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

[BUG] SetVehicleDoorBroken?

Open NoobySloth opened this issue 3 years ago • 3 comments

Describe the bug Well, only getting an error and the photo shows that

To Reproduce Uh, yeah idk? Break doors, store car and take it out again?

Expected behavior Doors to be broken I guess?

Screenshots image

Questions (please complete the following information):

  • When you last updated: [e.g. last week] 16 days ago
  • Are you using custom resource? which ones? https://github.com/JonasDev99/qb-garages
  • Have you renamed qb- to something custom? no

Additional context I see in the garage script it also handles door damage but yeah im not sure? sorry for the terrible bug report.. I only have an error to go off

NoobySloth avatar Apr 21 '22 15:04 NoobySloth

Best guess here is that the call from the 3rd party garage library is not sending back the same formatted object as what QBCore is using.

You can test this by modifying the garage library here: https://github.com/JonasDev99/qb-garages/blob/main/client/main.lua#L527 change the line above this to:

properties.doorStatus = nil

Then test and see if the error is gone or a new error occurs. If the error is gone, there is a problem with the custom resource and it will need to be updated to pass that data in to QBCore correctly.

nullvariable avatar Apr 22 '22 13:04 nullvariable

Alter line 650 in functions.lua so that it shows tonumber(doorIndex) instead of just doorindex.

Old/Busted: SetVehicleDoorBroken(vehicle, doorIndex, true) New/Not Busted: SetVehicleDoorBroken(vehicle, tonumber(doorIndex), true)

chrislenga avatar May 06 '22 10:05 chrislenga

Alter line 650 in functions.lua so that it shows tonumber(doorIndex) instead of just doorindex.

Old/Busted: SetVehicleDoorBroken(vehicle, doorIndex, true) New/Not Busted: SetVehicleDoorBroken(vehicle, tonumber(doorIndex), true)

this is what happen after i try to set SetVehicleDoorBroken(vehicle, tonumber(doorIndex), true)

  1. trying to break all the door of my vehicle.
  2. repair the vehicle and all the door has been fixed.
  3. store it to the garage.
  4. take it out from the garage and then the door is broken again like in the video.

Video

LYRYCAL avatar May 12 '22 19:05 LYRYCAL