Jump to content

Train Sync


MasterTobi

Recommended Posts

Posted

hey

i searched in the Forum and i read thats the Trains not drive if nobody in it is. is it correctly !?

if it´s wrong then is my question, why stops the train after 100meters to drive when i say

setTrainSpeed(thetrain,10)

Posted

Speed 10... Sounds pretty drastic, isn't somewhere between 1 and 1.5 the max speed of the Infernus? :shock:

Anyway, if a car goes further than a specific range, MTA doesn't do anything with it anymore until it comes back into the screen. The reason for this is that areas in GTA San Andreas beyond a specific distance from the camera (± 300 meters if I remember correctly) don't have any collisions and all that loaded.

It could also have something to do with a current bug with trains and corners. (issue #4829)

In the first case, you can try solving it by warping the player into the train, or let him follow it. In the second case, you can only put the train somewhere else, or try to fix the issue in the MTA source code. But that would be a very hard thing to do, so that means you'll just need to be patient in this case.

Posted

hm ok :( but there is function names engineSetModelLODDistance ( int model, float distance ). It means i can switch the distance from an object or model over 500units or not ?!

But when i write

engineSetModelLODDistance (449, 1000 )

or

Tram1 = createVehicle(449,1794.4580078125, -1953.744140625, 13.546875, 90.476531982422 )
engineSetModelLODDistance (Tram1, 1000 )

"499 = Tram" then say me the Console engineSetModelLODDistance attempt to call global

what is wrong?! i need help :)

Posted

I guess if you want your vehicle to be usable you are doing the createVehicle serverside, where engineSetModelLODDistance doesn't exist.

Posted
oh yes xD right :D

but

engineSetModelLODDistance (449, 1000 )

don´t go :)

You can't change LOD of vehicles AFAIK. Changing element's LOD distance higher than 500 has no effect because the element gets deleted.

Posted

hm

if i create a ped and port it into the tram then i have created a player so hypothetical or not ?! then have to drive the train from ls to SF because the Ped is a Player or not and the train/tram drives because the LOD is under 300units ?!

Posted

Every player is a ped but not every ped is a player. In this case, if I understood you correctly, you want a ped to drive a train? Then I'm guessing it won't work because peds don't sync but other players.

Posted

Hm...im not sure about that, but it should be possible to port your Ped into a Train

and setting his ControlState for driving forwards to true.

First you put your Ped into the Created Train (Vehicle-Definition "YourTrain") with the Ped-Definition "Traindriverped".

Then...

setTrainDerailable( YourTrain, false)
setPedControlState ( Traindriverped, "forwards", true )

After this you check if the Ped entered a Area/Gangzone (near a Station) and set the Trains Speed to 0.

Or you get the Players Speed and reduce the Speed till it´s 0.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...