Train issues - 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 issues (
/showthread.php?tid=354460)
Train issues -
coolmark1995 - 26.06.2012
ok hello today I wanted to add a train to ls train station but I dont know how to get the streak train cars to stay with it when I drive train the train cars dont follow what can I do to fix this? or get it working I dont know how to script it
I do not no what to do because you cant attach it with mta then copy it over
Re: Train issues -
Grand_Micha - 26.06.2012
Did you create the train with AddStaticVehicle? Alao, use AttachTraileToVehicle after you've created the wagons.
https://sampwiki.blast.hk/wiki/AttachTrailerToVehicle
Re: Train issues -
coolmark1995 - 26.06.2012
how many trailers could I attach? I need 4
Re: Train issues -
coolmark1995 - 26.06.2012
and how would I combine it was ad vehicle stats
Re: Train issues -
Grand_Micha - 26.06.2012
new Batz,TBatz,BBatz;
public OnGameModeInit()
{
Batz = AddStaticVehicle(Train info);
TBatz = AddStaticVehicle(1st trailer);
BBatz = AddStaticVehicle(2nd one);
}
public OnVehicleStreamIn(vehicleid,forplayerid)
{
if(vehicleid==Batz||vehicleid==BBatz||vehicleid==T Batz) AttachTrailerToVehicle(BBatz,Batz),AttachTrailerTo Vehicle(TBatz,BBatz);
return 1;
}
Re: Train issues -
coolmark1995 - 26.06.2012
where it says train info is that where I put the id?
Re: Train issues -
coolmark1995 - 26.06.2012
how do I add more then 2 trailers do I put tbatz again??
Re: Train issues -
Makaveli93 - 26.06.2012
Use AddStaticVehicle and spawn the train on the railroad. Use /save in-game to get the co-ordinates of the railroad.
Edit: Some threads I found regarding this issue
https://sampforum.blast.hk/showthread.php?tid=169916
https://sampforum.blast.hk/showthread.php?tid=281557
https://sampforum.blast.hk/showthread.php?tid=125054
Re: Train issues -
coolmark1995 - 26.06.2012
Quote:
Originally Posted by Makaveli93
|
thoughts posts dont help at all
Re: Train issues -
Makaveli93 - 26.06.2012
Well it's said in those posts that you need to spawn the train with AddStaticVehicle on the railroad. Why don't you try it?
Edit: Here:
This will spawn your train near Palomino Creek
pawn Код:
AddStaticVehicle(537,2457.2207,-274.1781,18.5465,86.1217,1,74); // train