Help with coding Road train for trucks -
NikiFor - 18.06.2014
Hi everyone! I came to you for help because the Portuguese forum they do not help me ... I wanted to make a script that makes a train road with trucks using code like / roadtrain. Thank you!
*The person who help me I put your credits in the code
**Sorry if I wrote something wrong
Re : Help with coding Road train for trucks -
S4t3K - 18.06.2014
Well, it's written there :
https://sampwiki.blast.hk/wiki/CreateVehicle
"Trains can only be added with AddStaticVehicle(Ex)". And because both of these functions can't be called out of "OnGameModeInit", your system isn't possible. Or have I missed something ?
Re: Re : Help with coding Road train for trucks -
NikiFor - 18.06.2014
Quote:
Originally Posted by S4t3K
Well, it's written there : https://sampwiki.blast.hk/wiki/CreateVehicle
"Trains can only be added with AddStaticVehicle(Ex)". And because both of these functions can't be called out of "OnGameModeInit", your system isn't possible. Or have I missed something ?
|
Edit: But there's a video of this maked by Snoob but he does not respond
Sorry i wrote wrong
Re: Re : Help with coding Road train for trucks -
NikiFor - 18.06.2014
Quote:
Originally Posted by S4t3K
Well, it's written there : https://sampwiki.blast.hk/wiki/CreateVehicle
"Trains can only be added with AddStaticVehicle(Ex)". And because both of these functions can't be called out of "OnGameModeInit", your system isn't possible. Or have I missed something ?
|
Quote:
Originally Posted by GCLeandroGC
Edit: But there's a video of this maked by Snoob but he does not respond
Sorry i wrote wrong
|
Sorry if i can't share links but i have to show what i want...
SA-MP RoadTrain script by snoob:
http://*********/7YyMinSMi8Q << see this...
Re: Help with coding Road train for trucks -
Threshold - 18.06.2014
https://sampwiki.blast.hk/wiki/AttachTrailerToVehicle
Re: Help with coding Road train for trucks -
NikiFor - 18.06.2014
Quote:
Originally Posted by Threshold
|
Hm... Thanks i will see if i can do it...
Re: Help with coding Road train for trucks -
Cena44 - 18.06.2014
If you mean the Roadtrain truck, here's a really basic snippet that spawns a trailer attached to it.
pawn Код:
#include ZCMD
CMD:roadtrain(playerid,params[])
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
new roadtraintruck = CreateVehicle(515, X, Y, Z, 0, COLORID1, COLORID2); // Make sure you set the colors.
PutPlayerInVehicle(playerid, roadtraintruck, 0);
new roadtraintrailer = CreateVehicle(435, X, Y, Z, 0, COLORID1, COLORID2); // Colors here too.
AttachTrailerToVehicle(roadtraintrailer, roadtraintruck);
return 1;
}
Re: Help with coding Road train for trucks -
NikiFor - 18.06.2014
Quote:
Originally Posted by Cena44
If you mean the Roadtrain truck, here's a really basic snippet that spawns a trailer attached to it.
pawn Код:
#include ZCMD
CMD:roadtrain(playerid,params[]) { new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z); new roadtraintruck = CreateVehicle(515, X, Y, Z, 0, COLORID1, COLORID2); // Make sure you set the colors. PutPlayerInVehicle(playerid, roadtraintruck, 0); new roadtraintrailer = CreateVehicle(435, X, Y, Z, 0, COLORID1, COLORID2); // Colors here too. AttachTrailerToVehicle(roadtraintrailer, roadtraintruck); return 1; }
|
Edit: i think that is not this but i can put in this code 2 trailers attached in the truck? Like truck+trailer+trailer?