JonasDev17 / qb-garages

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

destroyed cars do not get sent to impound. #139

Open zZzScripts opened 9 months ago

zZzScripts commented 9 months ago

When a player's car is destroyed or exploded. I have to manually send it to the impoundlot via the database.

real-general-iroh commented 7 months ago

Not a bug; garages are not intended to do this. You have to write a script to handle that yourself.

zZzScripts commented 5 months ago

Not a bug; garages are not intended to do this. You have to write a script to handle that yourself.

100% a bug. Switched to normal qb-garages and the vehicles go to the impound without me wasting my time manually sending them there via the database.

JonasDev17 commented 5 months ago

Not a bug; garages are not intended to do this. You have to write a script to handle that yourself.

100% a bug. Switched to normal qb-garages and the vehicles go to the impound without me wasting my time manually sending them there via the database.

No, It's not a bug, that's the way the code was written. Cause qb-garages just checks all the vehicles currently loaded client-side and if its not there then you're allowed to spawn it but this would allow players to dupe vehicles if the vehicle is far away and unloaded by the game. You have to introduce a game mechanic to delete destroyed vehicles.

ChrizsTTV commented 4 months ago

Has anyone a small snippet on how I could add this mechanic? Some Cars just despawn and I don't wanna restart the script or put the state inside the sql

real-general-iroh commented 4 months ago

Has anyone a small snippet on how I could add this mechanic? Some Cars just despawn and I don't wanna restart the script or put the state inside the sql

The solution I used was to add a little third eye option to all vehicles that only shows if the vehicle health is below a certain amount and it allows the player to delete the vehicle and get it from the impound. This is less client heavy, as you are not constantly checking the game pool. Hell, this implementation is easy enough to ask ChatGPT or Gemini to write it if you lack the knowledge. It can also explain the functions far better than I ever could.

JonasDev17 commented 4 months ago

Has anyone a small snippet on how I could add this mechanic? Some Cars just despawn and I don't wanna restart the script or put the state inside the sql

https://github.com/JonasDev17/qb-garages/compare/main...JonasDev17-patch-7

Try this, I haven't tested it though...

ChrizsTTV commented 4 months ago

I will try it now that u pushed it to main, thank you. What Can I do about Cars that despawn?

madmechanic187 commented 3 months ago

so what do we do with out the impound we need some sort of fix