Attaching other vehicles to the packer truck
#9

Fastest solution I came up with (probably while you were writing your last post, I didn't see it). Basically, I just got offset from packer and the location where the cars should be.

pawn Код:
public OnPlayerCommandText(playerid, const cmdtext[])
{

    if(strcmp(cmdtext, "/packer", true) == 0)
    {
        new packer, admirals[2];

        // spawn packer near player
        new Float:px, Float:py, Float:pz;
        GetPlayerPos(playerid, px, py, pz);

        #define packerx (px + 5.0)
        #define packery (py + 5.0)
        #define packerz (pz)

        packer = CreateVehicle(443, packerx, packery, packerz, 180.0, 0, 0, 0);

        // spawn admirals on packer
        admiral[0] = CreateVehicle(445, packerx + 0.060059, packery - 0.259766, packerz + 2.167205, 180.0f, 0, 0, 0);
        admiral[1] = CreateVehicle(445, packerx - 0.174805, packery + 7.21752, packerz + 0.114706, 180.0f, 0, 0, 0);

        #undef packerx, packery, packerz
        return 1;
    }

    return 1;
}
The result is: http://imgur.com/VsOZiSK
It's actually driveable!

Offsets are (as you can see in the script):
pawn Код:
// vehicle 1
x = + 0.060059
y = - 0.259766
z = + 2.167205

// vehicle 2
x = - 0.174805
y = + 7.21752
z = + 0.114706
You could also take a look at https://sampforum.blast.hk/showthread.php?tid=198885 and maybe use some of the code.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)