SA-MP Forums Archive
AttachTrailer. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: AttachTrailer. (/showthread.php?tid=182939)



AttachTrailer. - DyDy - 13.10.2010

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.


Re: AttachTrailer. - DarrenReeder - 13.10.2010

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));



Re: AttachTrailer. - DyDy - 13.10.2010

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


Re: AttachTrailer. - DarrenReeder - 13.10.2010

What, my method does?


Re: AttachTrailer. - Voldemort - 13.10.2010

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


Re: AttachTrailer. - Thebest96 - 13.10.2010

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?


Re: AttachTrailer. - DyDy - 13.10.2010

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.


Re: AttachTrailer. - Voldemort - 13.10.2010

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?


Re: AttachTrailer. - DyDy - 13.10.2010

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.


Re: AttachTrailer. - DyDy - 13.10.2010

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.