[DISCONTINUED] [ALPHA] Stop vehicle despawning

If you enable the debug mode in config.lua, do you see in the F8 client console the amount of cars restored, every x secs? If you don’t, then try to restart the resource and tell me whether it works or not.

1 Like

I will look into the netId stuff you are talking about, although it’s a bit buggy, from what I’ve seen. I’ll also try to use mission entity. Thanks for the feedback!

1 Like

Netids are not really buggy if you iknow how to use them properly as far as mission entity again if other scripts want to control the entity its not possible if its set as a mission entity i have tested this thoroughly and i can demonstrate it if you would like

Script is bugging like hell for me,

Every X amount of seconds, it simply respawns the same vehicle at my current spot (even if im in the vehicle) and simply keeps respawning every x seconds, no matter how many cars there are , or where i’m at

I know, I will probably discontinue the development cause I made it wrong from the beginning by not using mission entities nor netids. Also because I see no one is interested in this, and neither am I any longer.

well i certainly was as them objects keep de-spawning (pain in the a$$)

but i can understand where it’s coming from, thanks for the try and good luck on any further projects

Thanks bud. I’m currently working on a roleplay framework where I will need to code something like this script to let players park their cars in the streets without having them disappear. So I might take that code I’ll do, to do a script like this one, but properly working.

2 Likes

I’ve been messing around with the vehicle spawn function and apparently they don’t despawn at all untill you leave the server. So a good way to do it would be to spawn all the cars in the database when the first player joins after the server being empty, and I guess that’d be it. But that’d need some testing I don’t have time for at the moment.

i’d say make a marker (invisible, but tagged) at certain parking lots where you’d like them to be saved, so that whenever somone parks in that spot it will just cache it untill taken out. Wouldn’t that be a more simple way to succeed the plan?

I don’t have the time to save the coords of each parking spot in the map xd

I’d help you with that if i was still active at Fivem, ain’t though at this point, sorry :stuck_out_tongue:

1 Like

i just tested it and it respawned the vehicle every 10 seconds even if it was already respawned i had no errors in the console nothing the car from the medic got respawned every 10 seconds too when he parked his car in the garage it stopped respawning

2 Likes

image

Closing because it’s discontinued. Still leaving this listed so users can find the post.