PDA

View Full Version : Train spawn


whitedragon
21/08/2010, 12:36 PM
How spawn train?

Nonameman
21/08/2010, 12:57 PM
Get the coords of a railway point, then put them into the CreateVehicle or AddStaticVehicle function with the train's model.

Nonameman

nuriel8833
21/08/2010, 01:03 PM
Train can be spawned only on railway.so just get the XYZ of the railway

[XST]O_x
21/08/2010, 01:04 PM
And as written in the wiki,trains can only be created with AddStaticVehicle and not CreateVehicle.

Sting.
17/12/2012, 09:30 PM
Alright but how do you spawn passenger coaches? Like that's the engine, how do you spawn the coaches behind? or how you make them like connect each other?

Vince
17/12/2012, 10:35 PM
If I remember correctly it just spawns the train as a whole. So the engine and two or three carriages at once.

Ryan_Bowe
17/12/2012, 11:48 PM
The passenger cars will spawn when you spawn the train. @Vince, you are correct.

Sinner
18/12/2012, 07:42 AM
Here ya go, this spawns a train in all train stations:

AddStaticVehicleEx(537,1695.2631,-1953.6426,14.8756,89.9202,1,1, 120);
AddStaticVehicleEx(537, 1466.8977, 2632.2500,12.1256,270.0000,1,1, 120);
AddStaticVehicleEx(537, 2864.7500, 1254.7863,12.1256,180.0000,1,1, 120);
AddStaticVehicleEx(537,-1942.9858, 165.1703,27.0006,356.8288,1,1, 120);