Help with coding Road train for trucks
#1

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
Reply
#2

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 ?
Reply
#3

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
Reply
#4

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...
Reply
#5

https://sampwiki.blast.hk/wiki/AttachTrailerToVehicle
Reply
#6

Quote:
Originally Posted by Threshold
Посмотреть сообщение
Hm... Thanks i will see if i can do it...
Reply
#7

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;
}
Reply
#8

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)