01.12.2014, 01:42
I've made a function like this before. You can do it like you did before, and it should return their position. You can also try attaching an object and doing this:
Kinda like this:
https://sampforum.blast.hk/showthread.php?tid=541980
which i made a while ago
pawn Код:
stock GetObjectOffset(objectid, vehicleid, &Float: X, &Float: Y, &Float: Z)
{
new Float: pos[3], vpos[3];
GetObjectPos(objectid, pos[0], pos[1], pos[2]);
GetVehiclePos(vehicleid, vpos[0], vpos[1], vpos[2]);
new calcpos[3];
calcpos[0] = pos[0]-vpos[0];
calcpos[1] = pos[1]-vpos[1];
calcpos[2] = pos[2]-vpos[2];
X = calcpos[0];
Y = calcpos[1];
Z = calcpos[2];
return 1;
}
https://sampforum.blast.hk/showthread.php?tid=541980
which i made a while ago