Adjust a dynamic object POS to a vehicle without attaching
#2

You can calculate the offset of an object to a vehicle(assuming you already know where you want the object placed) by subtracting the larger offset with the smaller one.

Example(vx, vy, and vz are the offsets):
pawn Код:
new Float: x, Float: y, Float: z, Float: vx, Float: vy, Float: vz;
GetObjectPos(objectid, x, y, z);
GetVehiclePos(vehicleid, vx, vy, vz);

vx = (x > vx) ? (x) : (vx);
vy= (y > vy) ? (y) : (vy);
vz = (z > vz) ? (z) : (vz);
Reply


Messages In This Thread
Adjust a dynamic object POS to a vehicle without attaching - by AlexBlack - 22.06.2016, 11:13
Re: Adjust a dynamic object POS to a vehicle without attaching - by Abagail - 22.06.2016, 16:26

Forum Jump:


Users browsing this thread: 1 Guest(s)