Get player offset from a vehicle
#3

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:

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;
}
Kinda like this:
https://sampforum.blast.hk/showthread.php?tid=541980

which i made a while ago
Reply


Messages In This Thread
Get player offset from a vehicle - by Rodney Francalim - 30.11.2014, 19:43
Re: Get player offset from a vehicle - by Threshold - 01.12.2014, 01:36
Re: Get player offset from a vehicle - by Abagail - 01.12.2014, 01:42

Forum Jump:


Users browsing this thread: 1 Guest(s)