Vehicles Spawn on server start

Hello everyone! I am researching a way to spawn vehicles when the server starts, i tried several ways and due my lack of expertise with lua and/or fivem i am failing. LOL. This guy was very close of doing it: Release-boot-vehicles-v1-3-persistent-configured-vehicles but sadly it looks abandoned. I´ve take a look in the code and the plates are beeing generated wrong, some with 1 and some and 0. Tried to understand, or fix, failed and i gave up

In SA:MP we could spawn vehicles using something like “OnServerStart” and then just spawn all vehicles, simple as that. Any player that joins the server could see them. Each vehicle were indentified by a ID stored in the memory, generated in the order they were added in the database and/or xml file. I am having a hard time with this in FiveM + ESX.

I also tried codewalker but after hours trying i could not achieve what i want, carsgenerators simple dont spawn for me. The flag thing still a mistery . I managed to edit the map with no issues, but cars, that doesnt work at all.

I usually dont post anything here, but i see that people gets mad when you ask for something that is already there, but i could not find the answer, so if there is a solution anywhere and i am retard, please let me know.

Thanks!

You are going to have to use similar logic to my Boot Vehicles project to create vehicles when the “server starts”.

It shouldn’t take long too update, not a whole lot has changed, feel free to do it yourself. I do not have a whole lot of free time to maintain the project. It worked flawlessly as seen in the video on the project, and is exactly what you are looking for.

1 Like

Hey Slavko, it is what i need, many thanks for that. The issue were the plates returning 1 and 0. I just figured that if i remove the extras the plates start working again. Which is enough for me since this is just for organization vehicles(Police, EMS and so on) . I appreciate your effort and this great script.

Thanks

Hello…
did you solve the problem? since I’m facing it too