SA-MP Forums Archive
Help - 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: Help (/showthread.php?tid=531600)



Help - 123bob123 - 13.08.2014

How can I make a Tractor attaching a Farm Trailer, with a command. Maybe an example would be great

Already read this:

https://sampwiki.blast.hk/wiki/AttachTrailerToVehicle

I need an example please


Re: Help - [XST]O_x - 13.08.2014

pawn Код:
CMD:attachtrailer(playerid, params[])
{
    new trailerid, tractorid;
    new Float:pos[4];
    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    GetPlayerFacingAngle(playerid, pos[3]);
    tractorid = CreateVehicle(531, pos[0], pos[1], pos[2], pos[3], 0, 0, -1);
    trailerid = CreateVehicle(610, pos[0], pos[1]+5, pos[2]+5, pos[3], 0, 0, -1);
    AttatchTrailerToVehicle(trailerid, tractorid);
    PutPlayerInVehicle(playerid, tractorid, 0);
    return 1;
}