AttachTrailer.
#1

Hello. I'm trying to do some system, but it doesn't work.

Код:
Trailer[playerid] = CreateVehicle(584, 0.0, 0.0, 0.0, 0.0, -1, -1, -1);
AttachTrailerToVehicle(Trailer[playerid], GetPlayerVehicleID(playerid));
In attachtrailer function is said that will only work if both vehicles are streamed in. How to stream it? I don't understand well.
Reply
#2

I never tried attaching vehicles before, but i asume this means they have to be near each other...

Use GetVehiclePos and spawn the trailer on the vehicle you are attaching it to then attachtrailertovehicle..

see if that works
EDIT:

pawn Код:
new Float:x, Float:y, Float:z;
GetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
Trailer[playerid] = CreateVehicle(584, x, y, z, 0.0, -1, -1, -1);
AttachTrailerToVehicle(Trailer[playerid], GetPlayerVehicleID(playerid));
Reply
#3

No, it doesn't. It creates trailer on my tanker.
Reply
#4

What, my method does?
Reply
#5

Quote:
Originally Posted by DyDy
Посмотреть сообщение
No, it doesn't. It creates trailer on my tanker.
Use brains and for example use x+5.0
Reply
#6

Why you dont use IF player attach trAIller or something LOL
Are better
You need attach trailer if you want to drive... its this you want it?
Reply
#7

Quote:
Originally Posted by Thebest96
Посмотреть сообщение
Why you dont use IF player attach trAIller or something LOL
Are better
You need attach trailer if you want to drive... its this you want it?
Something like that. When I write command, server have to create trailer and attach it to me. I don't think that checking if trailer is attached would help. In wiki is said that both vehicles have to be streamed in, but I don't know how to do it.
Reply
#8

pawn Код:
new Float:x, Float:y, Float:z;
GetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
Trailer[playerid] = CreateVehicle(584, x, y+6.0, z, 0.0, -1, -1, -1);
AttachTrailerToVehicle(Trailer[playerid], GetPlayerVehicleID(playerid));
@DyDy , Do we need feed you with a fork and put food in your mouth?
Reply
#9

Quote:
Originally Posted by Voldemort
Посмотреть сообщение
[pawn]
@DyDy , Do we need feed you with a fork and put food in your mouth?
Yes, I'd be thankful.
Reply
#10

Quote:
Originally Posted by Voldemort
Посмотреть сообщение
pawn Код:
new Float:x, Float:y, Float:z;
GetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
Trailer[playerid] = CreateVehicle(584, x, y+6.0, z, 0.0, -1, -1, -1);
AttachTrailerToVehicle(Trailer[playerid], GetPlayerVehicleID(playerid));
It doesn't work still. Trailer creates somewhere near by tanker.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)