Old Post
Hi everyone, I've been working on this resource for a while now and I need testers to test it.
WHAT IT DOES NO ESX : it requires only the default resource of Fivem
It makes public transport aviable and fully configurable all managed by the game AI
-- Route path: First spawn point - Vechileshop - Central Garage
{
info = {
color = 84, -- Blip color
hash = "bus", -- Vehicle hash
busNum = 4, -- Num of buses for this route ( >= 1 )
timeBetweenBus = 40, -- Time in second between buses if busNum > 1
startHeading = 68.031 -- Bus heading when spawned
},
busStops = {
-- position, heading and a boolean: if true the bus will stop, if false the bus
-- won't stop but will pass the waypoint
{ pos = vector3(234.9626, -829.2527, 29.98755), stop = true },
{ pos = vector3(-232.1934, -983.7758, 28.60583), stop = true },
{ pos = vector3(-68.75604, -1078.668, 26.97144), stop = true },
{ pos = vector3(176.8747, -1030.365, 29.3136), stop = false },
{ pos = vector3(270.3956, -848.2022, 29.33044), stop = false },
}
},
-- You can add more routes
{
-- ...
},
WARNING
This resource has a lot of problems so it need to be tested and fixed, especially the online part that I couldn’t test as much as I wanted.
So please open issues on github
I choosed an ‘aggressive’ driving style to solve some problems.
In the decompiled scripts I found a driving style used for bus driving (1076369724) with some unknown flags I guess made for buses. Using a value like 525187 will make the bus take the curves wrong (like destroying traffic lights) and sometimes the bus won’t follow the navmesh
Another reason is that if the bus stops at every vehicle or ped if there are more than 1 bus per route they will end up crashing one into the other. Using 1076369724 as driving style help the buses have an equal distance (more or less)
About ‘Stop at traffic lights’ flag maybe it can be added in the config file as a boolean.
you could add a 3d text where busstops saying the time left to bus to reach to destination, if interested in creating an extended version of this contact me
I have tested the script and I have seen that it could not be restarted because it has functions with the playerDropped and PlayerJoined, I am looking on my own to do something but at the moment I have nothing.
I don’t know if you were referring to this problem.