Train spawn - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Train spawn (
/showthread.php?tid=169916)
Train spawn -
whitedragon - 21.08.2010
How spawn train?
Re: Train spawn -
Nonameman - 21.08.2010
Get the coords of a railway point, then put them into the CreateVehicle or AddStaticVehicle function with the train's model.
Nonameman
Re: Train spawn -
nuriel8833 - 21.08.2010
Train can be spawned only on railway.so just get the XYZ of the railway
Re: Train spawn -
[XST]O_x - 21.08.2010
And as written in the wiki,trains can only be created with AddStaticVehicle and not CreateVehicle.
Re: Train spawn -
Sting. - 17.12.2012
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?
Re: Train spawn -
Vince - 17.12.2012
If I remember correctly it just spawns the train as a whole. So the engine and two or three carriages at once.
Re: Train spawn -
Ryan_Bowe - 17.12.2012
The passenger cars will spawn when you spawn the train. @Vince, you are correct.
Re: Train spawn -
Sinner - 18.12.2012
Here ya go, this spawns a train in all train stations:
pawn Code:
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);