Trains

<< BACK TO SCRIPTS

Trains

Current Version: 2.52
Stand-Alone

Add Freight trains and Metro trains with purchasable tickets to ride. 

Also drive the trains

As seen on OCRP

ALSO: READ THE MANUAL before asking questions

Freight trains move all around the map on the freight tracks. Through south Los Santos, Senora Desert, Sandy Shores, Paleto, Great Ocean Highway, etc.

Metro trains move through the city. You can walk up to a ticket machine (red and black machines) and buy a ticket. When the train comes, get on and ride to whatever station you want to ride to.

Comes configured for NAT2K15, ESX, QBCore, BigDaddy money but can be turned off to just "pretend" to buy tickets. You can also configure whatever money framework you want to use by editing one function and adding your chosen framework to it.

You can now drive the trains. See documentation for how to do that.

Known Issues:

OneSync hates trains. Sometimes the game despawns only part of a train and leaves some orphans. This happens more often with more people on the server. I have tried to put in some checks to help remove the orphans but just know that they will happen.

 


Credits:

This idea has been out there and done a few times.

The spawning of trains as well as the "next stop" text was inspired by work from TheIndra55
The ticketing system was partially inspired by:
Blumlaut (FiveM Community) / Bluethefurry (Github)
Reworked by VenomXNL
(Re) Reworked by Nickoos

DOCUMENTATION
Available soon
Change Log

6/22/2023 - 2.52

  • Integrated BigDaddy-Money
  • Fixed QBCore money error when paying for ticket

4/11/2023 - v2.51 - Large update. Auto-indexing functionality added. Should stop the bad index = crash issue. Dead-man switch added. Train will stop when driver dies (or crashes out of the game). Throttle now only works while driver is in the train. Locales added so you can change the language or wording. Blips were made smaller by request. New money frameworks added.

2/27/2023 - v.2.4 - Trains are now driveable. See documentation on how. Also fixed a bug with ticket purchase not subtracting money. Optimization of the entire script. 

12/31/2022 - v2.3 - Updated licensing and resource startup to newer version which fixes a bug in the startup process.

12/28/2022 - v2.2 - Added config options to turn off/on Metro and/or Freight trains independently.

10/16/2022 - v2.1 - Just changed the freight train spawn frequency to five minutes instead of two. Helps keep the number of "orphan" cars down.