[SEMI-RELEASE] esx_jb_stopvehicledespawn

this script solution this problem ?

There is the little modified scripts files:
esx_jb_stopvehicledespawn_cl.lua (4.0 KB)
esx_jb_stopvehicledespawn_sv.lua (3.7 KB)

It’s working me 100%, on server start spawning my cars, if I’m rejoin to the server, spawn vehicle if not extist in the world IF staying any playern in 90 radius. (tested on onesync)
if car spawned it locked, i'm used carlock script, with this can open your owned cars, or comment out car lock section in client script. There is check car entity from server side, and pick one player who stay in dest, and send player for spawning car.

Need more:

  • implement car stat change on spawn car (for garage scripts)
  • improve getplate list
  • set minimal time to respawn car on rejoin
  • test on live server with 10+ player
  • networkid is locally? esx_garages script compatibility -> implement NetworkGetEntityIsLocal(veh entity)

Need modify your garage/policejob/mechanic/pound script:
For storage car to garage (no respawn car at CP)
TriggerServerEvent('esx_jb_stopvehicledespawn:vehicleenteredingarage', networkid)
For pound car (no respawn car if pound by police/mechanic) (need change sql in server script for your pound script)
TriggerServerEvent('esx_jb_stopvehicledespawn:deleteFromListAndPutInPound', networkid)

2 Likes

Hey @Deniel !

Nice job ! i’ll test that and give you a feedback !

Thanks for sharing your work

Hi Daniels, i use esx_drp_garage

where exactly I put the code.

I tried to do it but I could not locate the exact line where to put it, thanks

Hey,

I tested your modifications on my live server, and i still got duplicate vehicle every 40sec.

Same here with esx_advancedgarage

In save file still one car or duplicating there in?
Using onesync?

1 Like

I used the files u shared thank you, im now getting duplicates tho like others for police cars that are owned and also personal vehicles.

  • Using onesync?
  • In save file have 2 car entry?
  • How many player online?
  • spawn it if in car or not?
  • spawn it if you stay nearby car or not?

Hi @Deniel,

  • Using onesync?

No, i don’t use, i don’t have patreon

  • In save file have 2 car entry?
  • How many player online?

I tested in the night when i was the only one in the server

  • spawn it if in car or not?

Yes both

  • spawn it if you stay nearby car or not?

I haven’t tested if i’m far of the car, when i disconnect reconnect, after few seconds, the car respawn with dup cars, if i have one car , dup to 2, the next dup it will dup the 2 cars so 4 cars

Onesync is free :
https://forum.cfx.re/t/onesync-and-future-work-on-onesync/588531
Please check it with onesync if you can

Hum, i though oneSync was for patreon owner, in the link who gave me, i don’t see a download link

Just add +set onesync_enabled 1 to server startup script.

I do that but i have a message when i try to connect to server :slight_smile:

With me Spawnt only a car, but when I park it, spawns it again and I can the same car from the garage also ausparken … use esx_advancedgarage. I went to description, only the entry in the garage script does not work.
use onesync 64 players

nice new version. Got it working also with the esx_advancedgarage

only thing is
how to clear the file on a server restart since esx_advanded garage is setting back all cars in the garage after an restart?

Is there a function to clear the file on start of the resource?

Mine kept duplicating vehicle i left before because i dc-ed but the current vehicle i drive is working fine.

Sorry for late answer. I can check it at weekend. @wanfir019 @Zotti @StromaGames @Peacekeepers

@UltraTM your work fine without duplicate?

I tested it only alone yeasterday and adapt also the policegarage and ambulance garage to delete the car out of the file when parking the car. Also when impouund for police or Mechanic.
Today this evening i will test it with some more cars and 2 more players to test.

My tests worked fine that he deletes the car out of the file.

I will give you a feedback then.

I tested it works fine but it keeps duplicate when I disconnect and leave the car outside.