[RELEASE] FiveM Freight train (AI) and enterable trams (as passenger) (Suited for Roleplay to)

Those are not props unfortunately, if they where i would have included them to :frowning:
I have literally been at every train station to make the radius of it so you can enter/leave the metro. What needs to be done is making a list of cordinate points and heading to make sure we can override the location of the player when standing at one of those.

The object itself however is not usable since R* unfortunately included them as part of the map in those sections apparently.

I WILL include those locations when i have some time to spare, unfortunately currently quite busy with two other big releases still. so it’s on planning to also add those :slight_smile:

2 Likes

If you buy a ticket and then logout and back in again you lose your ticket :frowning:

Where did you buy the ticket?

@OpalaoComodoro86

Underground station.

This does not appear for me.

@OpalaoComodoro86 Make sure you download at the bottom of the post where it says “Where to download”. Most people (inc myself) originally download from the link that he put in the post that shows the one he based his off of not realizing that it was not his.
If you download the wrong one you cannot buy tickets, you have to get the one from his Github at the bottom of the post.
But anyway the OPs one has a bug where you buy a ticket and if you logout and back in you lose your ticket and have to buy another one.

This is correct, the original doesn’t have any ticket options or so. However the ‘losing the ticket’ isn’t a bug ;). it’s done on purpose this way so anyone can use his/her own database system to implement saving of the tickets for example (else i would have to make several ‘different versions’ just to support ticket saving and money deduction (if you look at the source code you will also see that the script currently does NOT take money (is also stated in the main post :slight_smile: )

There however IS a bug which is related to trains/metro’s de-spawning or not spawning for some people, we don’t have any issues but lots of people do. Currently it’s uncertain if this is due to natives (functions) of the game, if it’s due to conflicts between other scripts (we have found out by another user that BetterAI (some AI car script improvement) does cause issues with the native train spawning system though. So that is a bug that users currently should keep in mind when using the script.

The ‘losing the ticket’ however isn’t a bug, since users can implement this saving system on their own database if they want (either ESX, vRP, Es etc etc). Since my server is fully from scratch and doesn’t use any framework i decided not to implement my database saving (since it would not work for others) :slight_smile:

You can do it an easy way and make the ticket into an item in your inventory and then remove it when you enter the train. There is alot of ways to implement that the ticket stays after logout. Doing it the database way like OP says is also an option. but imo database for just an ticket to metro is kinda uneccesary

Well inventory IS in a database actually :wink: and was also what i was referring to :). My own (non published) framework uses a database with inventory for items, statistics and property ownerships for example, but this is exactly the reason why i have removed the ‘saving the ticked’ code from my release, since my database structure is very different from other commonly used systems like ESX.

Inventory is thus what i means (but still exactly the same: a database)

Yeah that is true, but when i read the comments i got the feeling that you guys where talking about making a single table just for the tickets to the metro and that felt weird haha :smiley:

1 Like

Hahah no definitely not haha, would for sure be massive overkill and resource wasting haha :stuck_out_tongue:

this prop is part of the train station, look for dt1_21_station

Indeed @Maxime_Brunaux, WPPTah is right, this however means that you can’t use the prop/item/object for (decent) detection to use those ticket machines… however it is possible to do this with radius detection for example. When i get more time again (not much spare time at the moment) i have already planned to implement it this way.

:slight_smile:

Hello, I made you a quick change for ticket machines that are not detected.
just put the file in your resource/XNL-FiveM-Trains-U3/stream, add this_is_a_map ‘yes’ in the _ressource.lua and restart the server.

this will add the props detected on those not detected.

I did it quickly so it’s normal that we see defects.
I only did it at the station on the highway.

tell me if there are others and their coordinates and I will add them.

have fun :slight_smile:

Bonjour, je vous ai fait une petite modification rapide pour les machines a ticket qui ne sont pas detecté.
il suffit de mettre le fichier dans votre ressource/XNL-FiveM-Trains-U3/stream, d’ajouter this_is_a_map ‘yes’ dans le _ressource.lua et relancer le serveur.

cela rajoutera les props detecté sur ceux non detecté.

Je l’ai fait rapidement donc c’est normal qu’on vois des defauts.
je ne l’ai fait que a la station qui est sur l’autoroute.

dites moi si il y en as d’autres et leurs coordonée et je les rajouterais.

amusez vous bien :slight_smile:

2 Likes

There is actually a way to make trains stop at train stations. For example this script is able to do it: https://github.com/TomGrobbe/FiveM-Trains

2 Likes

Yup i’m aware of this method, but that includes in “taking over” the whole train system and running a server script (or DLL in your link) to handle the trains.

However what I’m/we’re aiming for with our server (and the release scripts that are being developed due to that) is re-enabling or ‘re-activating’ the native game functions without overriding them. Since overriding such functions can (will) also introduce other complications with other scripts or the game itself.

However currently i unfortunately (still) don’t have much spare time due to family circumstances, but when possible i will definitely return to the trains mechanism and researching into the natives more deeply :slight_smile:

Thanks for your suggestion though :slight_smile:

1 Like

Or you just do this and you have native trains, the exact way Rockstar do it in Online.

Citizen.CreateThread(function()
  SwitchTrainTrack(0, true)
  SwitchTrainTrack(3, true)
  N_0x21973bbf8d17edfa(0, 120000)
  SetRandomTrains(1)
end)
1 Like

THANK YOU! Will definitly look into this one to implement it! :smiley: :smiley: :smiley:

This is exactly what we where looking for!

Thanks Mate!

:smiley:

BTW Would I still need to spawn them manually or does this routine also takes care of that part?

This does it all.

1 Like