[RELEASE] FiveM-Trains : Complete standalone AI trains system and enterable trains

Why does my game crash 10 seconds after loading when my character spawns?

[Window Title]
Error GTA5_b2372.exe!sub_140342284 (0x6c)
[Main Instruction]
GTA5_b2372.exe!sub_140342284 (0x6c)
[Content]
An error at GTA5_b2372.exe!sub_140342284 (0x6c) caused FiveM to stop working. A crash report is being uploaded to the FiveM developers.

Legacy crash hash: purple-uniform-beer
Stack trace:
GTA5_b2372.exe!sub_140342284 (0x6c)
GTA5_b2372.exe!sub_140387D84 (0x12)
GTA5_b2372.exe!sub_1403B45A0 (0x62)
GTA5_b2372.exe!?PreUpdate@audController@rage@@S?_PI@Z (0xba)
GTA5_b2372.exe!sub_1403F8390 (0x995)
GTA5_b2372.exe!sub_1403406F0 (0xa5)
GTA5_b2372.exe!StartAddress (0xfd)

1 Like

It happens to me rarely with this script. And by that I mean like 1 in 20 load ins. Always immediately the second I spawn as it tries to spawn trains to me. I kinda gave up on trying to fix. Its only when I’m the very first player on the server after restart.

could try increasing the delay maybe

All 10 out of 10 attempts failed.
I tried to change the delay in the script to a higher one, it did not help.

ps.

Edit

		Train = CreateMissionTrain(math.random(0,22), x,y,z,yesorno)

to

		Train = CreateMissionTrain(math.random(0,16), x,y,z,yesorno)

will help with the REALLY long train from the mission with Trevor I believe and thus potentially you wont have left over cars everywhere. MAYBE. Not sure yet.

It did not help.

Have you been testing with multiple people where someone leaves then another person becomes the host?

Everyone crashes the game.

Does anyone know how to make a livery for the metros?

Extract the livery from metrotrain.ytd in your GTAV files
edit it and replace it

Anyone have issues still with Freight Train spawning in LS on the Metro tracks? I cannot seem to fix that one

where would i happen to find the metrotrain.ytd its not in the files for this script

You have to extract it. Search for it in OpenIV from your GTAV files

Is there any plans on compatibility with onesync or any workaround that we can do?
Thanks!

This is for metro, or train (freigh)??

heyy, how we can make freight train to stop? how to add stop points to freight? thanks for answer.

Is it possible to link this with a standalone script such as GitHub - NAT2K15/fivem-money-system: Standalone money system if so, May I get some assistance?

if anyone got issue

add this into the request model

Blockquote
tempmodel = GetHashKey(“freightcar2”)
RequestModel(tempmodel)
while not HasModelLoaded(tempmodel) do
RequestModel(tempmodel)
Citizen.Wait(0)
end

then

change

Train = CreateMissionTrain(math.random(0,22), x,y,z,yesorno)

to

Train = CreateMissionTrain(math.random(0,26), x,y,z,yesorno)

and then

MetroTrain = CreateMissionTrain(24,40.2,-1201.3,31.0,true)
MetroTrain2 = CreateMissionTrain(24,-618.0,-1476.8,16.2,true)
to

MetroTrain = CreateMissionTrain(27,40.2,-1201.3,31.0,true)
MetroTrain2 = CreateMissionTrain(27,-618.0,-1476.8,16.2,true)

it should fix some issue